deno icon indicating copy to clipboard operation
deno copied to clipboard

npm package node-xlsx can not work

Open wangfeng1994 opened this issue 1 year ago • 8 comments

Version: Deno 1.41.0

wangfeng1994 avatar Feb 23 '24 05:02 wangfeng1994

无标题

wangfeng1994 avatar Feb 23 '24 05:02 wangfeng1994

Took a quick look what's happening and the node-xlsx package has this in their dependencies:

// package.json
{
  "dependencies": {
     "xlsx": "https://cdn.sheetjs.com/xlsx-0.19.3/xlsx-0.19.3.tgz"
  }
}

The URL points to a standard npm tarball and checking with the npm docs they do allow specifying dependencies with tarball http urls https://docs.npmjs.com/cli/v10/configuring-npm/package-json#dependencies . It's something we seemingly haven't implemented yet.

marvinhagemeister avatar Mar 29 '24 11:03 marvinhagemeister

thanks

wangfeng1994 avatar Apr 05 '24 08:04 wangfeng1994

please fix it

wangfeng1994 avatar Oct 06 '24 10:10 wangfeng1994

Any updates on this?

I tried everything, including installing a recent version from JSR import * as mod from "@mirror/xlsx";

But getting error

plugin:vite:import-analysis] Failed to resolve import "@ mirror/xlsx" from "src/utils/openXLSFile.ts". Does the file exist?

OleksiiPylypcuk-cnic avatar Oct 17 '24 02:10 OleksiiPylypcuk-cnic

UPD: solved with https://docs.sheetjs.com/docs/getting-started/installation/deno/

OleksiiPylypcuk-cnic avatar Oct 17 '24 02:10 OleksiiPylypcuk-cnic

thanks

wangfeng1994 avatar Oct 17 '24 02:10 wangfeng1994

import * as XLSX from 'https://cdn.sheetjs.com/xlsx-0.20.3/package/xlsx.mjs'; -> working

// import * as XLSX from 'xlsx'. -> not working, despite having

  "imports": {
    "xlsx": "https://cdn.sheetjs.com/xlsx-0.20.3/package/xlsx.mjs"
  }

in deno.json

OleksiiPylypcuk-cnic avatar Oct 17 '24 02:10 OleksiiPylypcuk-cnic

Can this issue be closed now?

kt3k avatar Nov 27 '24 06:11 kt3k

ok 

反反复复 @.***

 

------------------ 原始邮件 ------------------ 发件人: "denoland/deno" @.>; 发送时间: 2024年11月27日(星期三) 下午2:11 @.>; @.@.>; 主题: Re: [denoland/deno] npm package node-xlsx can not work (Issue #22554)

Can this issue be closed now?

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

wangfeng1994 avatar Nov 27 '24 06:11 wangfeng1994