我尝试在 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
有什么想法吗?
谢谢!
问:有什么想法吗?
A:
欢迎来到 ZeroMQ 俱乐部。
最好的下一步是联系
npm
软件包维护者,显示错误日志并遵循他们的纠正措施以进行正确的软件包安装。
确保有:
Node.js 10+ 或 Electron 3+
带有 make 的有效 C++17 编译器工具链
Python 2.7(或带有 Node 12.13+ 的 Python 3)
CMake 2.8+
卷曲
$ apt-get install pkg-config cmake curl g++ python3 libzmq --yes
$ apk 添加 pkgconfig 构建基础 cmake curl
$ apk 添加 --update --no-cache python3
$ ln -sf python3 /usr/bin/python
找到适合您系统的相关下载方法。如果你不在 docker 中,请添加 sudo。