Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No Windows pre-built binary for NodeJS v22 (v127) #112

Open
kpapadatos opened this issue Aug 14, 2024 · 2 comments
Open

No Windows pre-built binary for NodeJS v22 (v127) #112

kpapadatos opened this issue Aug 14, 2024 · 2 comments

Comments

@kpapadatos
Copy link

https://npm.duckdb.org/duckdb/duckdb-v1.0.0-node-v127-win32-x64.tar.gz returns 403:

<Error>
<Code>AccessDenied</Code>
<Message>Access Denied</Message>
<RequestId>KCH4693WWH72J55S</RequestId>
<HostId>C18voaYRCPs6lat15Or5TlLjqoAnlI+KTRha1rmPI98bX8SwJOV0xlx76pimJrl0I6oLHtKgSEc=</HostId>
</Error>
@kpapadatos kpapadatos changed the title No pre-built binary for NodeJS v22 (v127) No Windows pre-built binary for NodeJS v22 (v127) Aug 14, 2024
@tomnattle
Copy link

问题找到了,原因是,
node_modules@mapbox\node-pre-gyp 这目录下的文件不完整,下图是完整的,文件
企业微信截图_17340567466092

通过 registry.npmmirror.com下载的包是完整的

"@mapbox/node-pre-gyp@^1.0.0":
  version "1.0.11"
  resolved "https://registry.npmmirror.com/@mapbox/node-pre-gyp/-/node-pre-gyp-1.0.11.tgz#417db42b7f5323d79e93b34a6d7a2a12c0df43fa"
  integrity sha512-Yhlar6v9WQgUp/He7BdgzOz8lqMQ8sU+jkCq7Wx8Myc5YFJLbEe7lgui/V7G1qB1DJykHSGwreceSaD60Y0PUQ==
  dependencies:
    detect-libc "^2.0.0"
    https-proxy-agent "^5.0.0"
    make-dir "^3.1.0"
    node-fetch "^2.6.7"
    nopt "^5.0.0"
    npmlog "^5.0.1"
    rimraf "^3.0.2"
    semver "^7.3.5"
    tar "^6.1.11"

如果不是这个仓库地址下载的包,缺失文件,

"@mapbox/node-pre-gyp@^1.0.0":
  version "1.0.11"
  resolved "https://mirrors.cloud.tencent.com/npm/@mapbox/node-pre-gyp/-/node-pre-gyp-1.0.11.tgz#417db42b7f5323d79e93b34a6d7a2a12c0df43fa"
  integrity sha512-Yhlar6v9WQgUp/He7BdgzOz8lqMQ8sU+jkCq7Wx8Myc5YFJLbEe7lgui/V7G1qB1DJykHSGwreceSaD60Y0PUQ==
  dependencies:
    detect-libc "^2.0.0"
    https-proxy-agent "^5.0.0"
    make-dir "^3.1.0"
    node-fetch "^2.6.7"
    nopt "^5.0.0"
    npmlog "^5.0.1"
    rimraf "^3.0.2"
    semver "^7.3.5"
    tar "^6.1.11"

企业微信截图_17340565479587

为什么会这样尼?

因为这两个项目,其中一个走了 npm 源下载,另一个直接是官网下载。 我这边有个同事给项目引入了 canvas包,这个包依赖 @mapbox/node-pre-gyp@^1.0.0 , 他从源仓库下载了改文件导致的。删除这个包,项目中的 node-pre-gyp 又恢复到 从官网下载,这里 有点迷。


由于上述问题,导致编译失败,这个项目会做最后的尝试,他会去尝试下载预编译文件,duckdb-v1.0.0-node-v127-win32-x64,而这个预编译文件时不存在的, 因为官方没有上传改文件,因此下载会失败。
你要下载的是,duckdb-v1.0.0和node-v127环境的编译产物,而我则是下载这个,https://npm.duckdb.org/duckdb/duckdb-v1.1.3-electron-v30.1-win32-x64.tar.gz,一样也是不存在的。 因此你要检查 node_modules\@mapbox\node-pre-gyp\node_modules下面的文件是否完整。如下cai才是完整的。
企业微信截图_173405720519

@tomnattle
Copy link

How to specify the registry in package.json:
You can define the registry for a specific package using the npm configuration or within the package.json file.

Using .npmrc file
You can configure the registry for the specific package like this:

Create a .npmrc file in the root of your project (if it doesn't already exist).
Add the registry URL for the @mapbox scope:
bash
复制代码@mapbox:registry=https://registry.npmmirror.com/
This will ensure that the @mapbox scoped packages are fetched from the specified registry (https://registry.npmmirror.com/ in this case).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants