npm install Zeromq 出现错误

问题描述 投票:0回答:2

我尝试在 MacOS 11.5.2 上通过

npm install zeromq@5
安装 ZeroMQ v5,但我收到以下错误:

其他规格: 节点 v16.2.0 - Python 2.7.16 - 节点 gyp v3.8.0

npm ERR! code 1
npm ERR! command failed
npm ERR! command sh -c node-gyp-build || npm run build:libzmq
npm ERR! > [email protected] build:libzmq
npm ERR! > node-gyp rebuild
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using [email protected]
npm ERR! gyp info using [email protected] | darwin | x64
npm ERR! (node:1703) [DEP0150] DeprecationWarning: Setting process.config is deprecated. In the future the property will be read-only.
npm ERR! (Use `node --trace-deprecation ...` to show where the warning was created)
npm ERR! gyp info spawn /usr/bin/python2.7
npm ERR! No receipt for 'com.apple.pkg.CLTools_Executables' found at '/'. 
npm ERR! gyp: No Xcode or CLT version detected!
npm ERR! gyp ERR! configure error 
npm ERR! gyp ERR! stack Error: `gyp` failed with exit code: 1
npm ERR! gyp ERR! stack     at ChildProcess.onCpExit 
npm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:365:28)
npm ERR! gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:290:12)
npm ERR! gyp ERR! System Darwin 20.6.0
npm ERR! gyp ERR! node -v v16.2.0
npm ERR! gyp ERR! node-gyp -v v3.8.0
npm ERR! gyp ERR! not ok 
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using [email protected]
npm ERR! gyp info using [email protected] | darwin | x64
npm ERR! (node:1724) [DEP0150] DeprecationWarning: Setting process.config is deprecated. In the future the property will be read-only.
npm ERR! (Use `node --trace-deprecation ...` to show where the warning was created)
npm ERR! gyp info spawn /usr/bin/python2.7
npm ERR! gyp: No Xcode or CLT version detected!
npm ERR! gyp ERR! configure error 
npm ERR! gyp ERR! stack Error: `gyp` failed with exit code: 1
npm ERR! gyp ERR! stack     at ChildProcess.onCpExit (/Users/cdgmachado/node_modules/node-gyp/lib/configure.js:345:16)
npm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:365:28)
npm ERR! gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:290:12)
npm ERR! gyp ERR! System Darwin 20.6.0
npm ERR! gyp ERR! command "/usr/local/bin/node" "/Users/cdgmachado/node_modules/.bin/node-gyp" "rebuild"
npm ERR! gyp ERR! node -v v16.2.0
npm ERR! gyp ERR! node-gyp -v v3.8.0
npm ERR! gyp ERR! not ok

有什么想法吗?

谢谢!

node.js npm npm-install zeromq failed-installation
2个回答
0
投票

问:有什么想法吗?

A:
欢迎来到 ZeroMQ 俱乐部。

最好的下一步是联系

npm
软件包维护者,显示错误日志并遵循他们的纠正措施以进行正确的软件包安装。


0
投票

确保有:

  1. Node.js 10+ 或 Electron 3+

  2. 带有 make 的有效 C++17 编译器工具链

  3. Python 2.7(或带有 Node 12.13+ 的 Python 3)

  4. CMake 2.8+

  5. 卷曲

    适用于 debian linux

    $ apt-get install pkg-config cmake curl g++ python3 libzmq --yes

    对于 alpine linux

    $ apk 添加 pkgconfig 构建基础 cmake curl

    $ apk 添加 --update --no-cache python3

    $ ln -sf python3 /usr/bin/python

找到适合您系统的相关下载方法。如果你不在 docker 中,请添加 sudo。

© www.soinside.com 2019 - 2024. All rights reserved.