为什么我可以使用NPM安装软件包,但不能安装纱线,为什么似乎有幽灵依赖性?

发布于 2025-02-08 21:34:33 字数 5929 浏览 2 评论 0 原文

我使用的是节点12.22.10,NPM 8.12.2和YARN 3.2.1(YARN是该项目使用的软件包管理器)。

当我尝试安装 YARN添加-d @OpenGSN/dev 时,我会遇到故障:

➤ YN0000: ┌ Resolution step
➤ YN0013: │ web3-provider-engine@https://github.com/trufflesuite/provider-engine.git#commit=9694f5b4e5500651bd2ff689df8529bb5cf6b96f ca
➤ YN0013: │ web3-provider-engine@https://github.com/trufflesuite/provider-engine.git#commit=9694f5b4e5500651bd2ff689df8529bb5cf6b96f ca
➤ YN0058: │ web3-provider-engine@https://github.com/trufflesuite/provider-engine.git#commit=9694f5b4e5500651bd2ff689df8529bb5cf6b96f: Packing the package failed (exit code 1, logs can be found here: /tmp/xfs-0b17fb30/pack.log)
➤ YN0000: └ Completed in 59s 408ms
➤ YN0000: Failed with errors in 59s 409ms

日志非常长,但是我认为错误是由于对 [email  procepted] ,我从其他地方回想起,我还回想起其他地方是不兼容的。 。

我认为日志中的主要错误描述在这里:

5923 verbose stack Error: command failed
5923 verbose stack     at ChildProcess.<anonymous> (/home/azureuser/.nvm/versions/node/v12.22.10/lib/node_modules/npm/node_modules/@npmcli/promise-spawn/lib/index.js:63:27)
5923 verbose stack     at ChildProcess.emit (events.js:314:20)
5923 verbose stack     at maybeClose (internal/child_process.js:1022:16)
5923 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:287:5)
5924 verbose pkgid [email protected]
5925 verbose cwd /tmp/xfs-fef0f98c
5926 verbose Linux 5.13.0-1022-azure
5927 verbose node v12.22.10
5928 verbose npm  v8.12.2
5929 error code 1
5930 error path /tmp/xfs-fef0f98c/node_modules/sha3
5931 error command failed
5932 error command sh -c node-gyp rebuild
5933 error make: Entering directory '/tmp/xfs-fef0f98c/node_modules/sha3/build'
5933 error   CXX(target) Release/obj.target/sha3/src/addon.o
5933 error make: Leaving directory '/tmp/xfs-fef0f98c/node_modules/sha3/build'
5934 error gyp info it worked if it ends with ok
5934 error gyp info using [email protected]
5934 error gyp info using [email protected] | linux | x64
5934 error gyp info find Python using Python version 3.10.4 found at "/usr/bin/python3"
5934 error gyp info spawn /usr/bin/python3
5934 error gyp info spawn args [
5934 error gyp info spawn args   '/home/azureuser/.nvm/versions/node/v12.22.10/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
5934 error gyp info spawn args   'binding.gyp',
5934 error gyp info spawn args   '-f',
5934 error gyp info spawn args   'make',
5934 error gyp info spawn args   '-I',
5934 error gyp info spawn args   '/tmp/xfs-fef0f98c/node_modules/sha3/build/config.gypi',
5934 error gyp info spawn args   '-I',
5934 error gyp info spawn args   '/home/azureuser/.nvm/versions/node/v12.22.10/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
5934 error gyp info spawn args   '-I',
5934 error gyp info spawn args   '/home/azureuser/.cache/node-gyp/12.22.10/include/node/common.gypi',
5934 error gyp info spawn args   '-Dlibrary=shared_library',
5934 error gyp info spawn args   '-Dvisibility=default',
5934 error gyp info spawn args   '-Dnode_root_dir=/home/azureuser/.cache/node-gyp/12.22.10',
5934 error gyp info spawn args   '-Dnode_gyp_dir=/home/azureuser/.nvm/versions/node/v12.22.10/lib/node_modules/npm/node_modules/node-gyp',
5934 error gyp info spawn args   '-Dnode_lib_file=/home/azureuser/.cache/node-gyp/12.22.10/<(target_arch)/node.lib',
5934 error gyp info spawn args   '-Dmodule_root_dir=/tmp/xfs-fef0f98c/node_modules/sha3',
5934 error gyp info spawn args   '-Dnode_engine=v8',
5934 error gyp info spawn args   '--depth=.',
5934 error gyp info spawn args   '--no-parallel',
5934 error gyp info spawn args   '--generator-output',
5934 error gyp info spawn args   'build',
5934 error gyp info spawn args   '-Goutput_dir=.'
5934 error gyp info spawn args ]
5934 error gyp info spawn make
5934 error gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]

... snipping all the compiler error detail ...

5934 error make: *** [sha3.target.mk:115: Release/obj.target/sha3/src/addon.o] Error 1
5934 error gyp ERR! build error 
5934 error gyp ERR! stack Error: `make` failed with exit code: 2
5934 error gyp ERR! stack     at ChildProcess.onExit (/home/azureuser/.nvm/versions/node/v12.22.10/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
5934 error gyp ERR! stack     at ChildProcess.emit (events.js:314:20)
5934 error gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:276:12)
5934 error gyp ERR! System Linux 5.13.0-1022-azure
5934 error gyp ERR! command "/home/azureuser/.nvm/versions/node/v12.22.10/bin/node" "/home/azureuser/.nvm/versions/node/v12.22.10/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
5934 error gyp ERR! cwd /tmp/xfs-fef0f98c/node_modules/sha3
5934 error gyp ERR! node -v v12.22.10
5934 error gyp ERR! node-gyp -v v9.0.0
5934 error gyp ERR! not ok
5935 verbose exit 1

麻烦是我看不到依赖关系的来源。我无法运行纱线为什么因为我无法安装软件包,但是 npm-remote-ls 不显示 [email&nbsp; procearted] 在依赖树中的任何地方。

对我来说更奇怪, npm install -G @OpenGSN/dev 成功了,再次, npm ls [email&nbsp; prectioned] 没有显示任何内容。

我很想弄清楚如何解决这个问题。我无法将我的节点版本降级到与过时的SHA3版本兼容的节点版本。

I am using Node 12.22.10, npm 8.12.2 and yarn 3.2.1 (yarn is the package manager in use for the project).

When I try to install yarn add -D @opengsn/dev I am getting a failure:

➤ YN0000: ┌ Resolution step
➤ YN0013: │ web3-provider-engine@https://github.com/trufflesuite/provider-engine.git#commit=9694f5b4e5500651bd2ff689df8529bb5cf6b96f ca
➤ YN0013: │ web3-provider-engine@https://github.com/trufflesuite/provider-engine.git#commit=9694f5b4e5500651bd2ff689df8529bb5cf6b96f ca
➤ YN0058: │ web3-provider-engine@https://github.com/trufflesuite/provider-engine.git#commit=9694f5b4e5500651bd2ff689df8529bb5cf6b96f: Packing the package failed (exit code 1, logs can be found here: /tmp/xfs-0b17fb30/pack.log)
➤ YN0000: └ Completed in 59s 408ms
➤ YN0000: Failed with errors in 59s 409ms

The logs are extremely long, but I think the error is due to a dependency on [email protected] which I recall from somewhere else is incompatible with newer Node versions.

I think the main error description in the logs is here:

5923 verbose stack Error: command failed
5923 verbose stack     at ChildProcess.<anonymous> (/home/azureuser/.nvm/versions/node/v12.22.10/lib/node_modules/npm/node_modules/@npmcli/promise-spawn/lib/index.js:63:27)
5923 verbose stack     at ChildProcess.emit (events.js:314:20)
5923 verbose stack     at maybeClose (internal/child_process.js:1022:16)
5923 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:287:5)
5924 verbose pkgid [email protected]
5925 verbose cwd /tmp/xfs-fef0f98c
5926 verbose Linux 5.13.0-1022-azure
5927 verbose node v12.22.10
5928 verbose npm  v8.12.2
5929 error code 1
5930 error path /tmp/xfs-fef0f98c/node_modules/sha3
5931 error command failed
5932 error command sh -c node-gyp rebuild
5933 error make: Entering directory '/tmp/xfs-fef0f98c/node_modules/sha3/build'
5933 error   CXX(target) Release/obj.target/sha3/src/addon.o
5933 error make: Leaving directory '/tmp/xfs-fef0f98c/node_modules/sha3/build'
5934 error gyp info it worked if it ends with ok
5934 error gyp info using [email protected]
5934 error gyp info using [email protected] | linux | x64
5934 error gyp info find Python using Python version 3.10.4 found at "/usr/bin/python3"
5934 error gyp info spawn /usr/bin/python3
5934 error gyp info spawn args [
5934 error gyp info spawn args   '/home/azureuser/.nvm/versions/node/v12.22.10/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
5934 error gyp info spawn args   'binding.gyp',
5934 error gyp info spawn args   '-f',
5934 error gyp info spawn args   'make',
5934 error gyp info spawn args   '-I',
5934 error gyp info spawn args   '/tmp/xfs-fef0f98c/node_modules/sha3/build/config.gypi',
5934 error gyp info spawn args   '-I',
5934 error gyp info spawn args   '/home/azureuser/.nvm/versions/node/v12.22.10/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
5934 error gyp info spawn args   '-I',
5934 error gyp info spawn args   '/home/azureuser/.cache/node-gyp/12.22.10/include/node/common.gypi',
5934 error gyp info spawn args   '-Dlibrary=shared_library',
5934 error gyp info spawn args   '-Dvisibility=default',
5934 error gyp info spawn args   '-Dnode_root_dir=/home/azureuser/.cache/node-gyp/12.22.10',
5934 error gyp info spawn args   '-Dnode_gyp_dir=/home/azureuser/.nvm/versions/node/v12.22.10/lib/node_modules/npm/node_modules/node-gyp',
5934 error gyp info spawn args   '-Dnode_lib_file=/home/azureuser/.cache/node-gyp/12.22.10/<(target_arch)/node.lib',
5934 error gyp info spawn args   '-Dmodule_root_dir=/tmp/xfs-fef0f98c/node_modules/sha3',
5934 error gyp info spawn args   '-Dnode_engine=v8',
5934 error gyp info spawn args   '--depth=.',
5934 error gyp info spawn args   '--no-parallel',
5934 error gyp info spawn args   '--generator-output',
5934 error gyp info spawn args   'build',
5934 error gyp info spawn args   '-Goutput_dir=.'
5934 error gyp info spawn args ]
5934 error gyp info spawn make
5934 error gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]

... snipping all the compiler error detail ...

5934 error make: *** [sha3.target.mk:115: Release/obj.target/sha3/src/addon.o] Error 1
5934 error gyp ERR! build error 
5934 error gyp ERR! stack Error: `make` failed with exit code: 2
5934 error gyp ERR! stack     at ChildProcess.onExit (/home/azureuser/.nvm/versions/node/v12.22.10/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
5934 error gyp ERR! stack     at ChildProcess.emit (events.js:314:20)
5934 error gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:276:12)
5934 error gyp ERR! System Linux 5.13.0-1022-azure
5934 error gyp ERR! command "/home/azureuser/.nvm/versions/node/v12.22.10/bin/node" "/home/azureuser/.nvm/versions/node/v12.22.10/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
5934 error gyp ERR! cwd /tmp/xfs-fef0f98c/node_modules/sha3
5934 error gyp ERR! node -v v12.22.10
5934 error gyp ERR! node-gyp -v v9.0.0
5934 error gyp ERR! not ok
5935 verbose exit 1

The trouble is I can't see where the dependency is coming from. I can't run yarn why because I can't install the package, but npm-remote-ls doesn't show [email protected] anywhere in the dependency tree.

Even more strange to me, npm install -g @opengsn/dev is successful, and again, npm ls [email protected] doesn't show anything.

I'd love to work out how to fix this. I can't downgrade my Node version to one that is compatible with the outdated sha3 versions.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文