简体   繁体   English

在 MAC OS 上安装生成器超级账本作曲家时出错

[英]Error installing generator hyperledger composer on MAC OS

I am trying to install the Hyperledger Composer development environment on my Mac.我正在尝试在我的 Mac 上安装 Hyperledger Composer 开发环境。 But when I try to install CLI tools with the command:但是当我尝试使用以下命令安装 CLI 工具时:

npm install -g composer-cli npm install -g composer-cli

the following error message shows up.出现以下错误消息。 I have tried to rollback the node version to 6/7 without success.我试图将节点版本回滚到 6/7,但没有成功。

npm WARN deprecated fs-promise@1.0.0: Use mz or fs-extra^3.0 with Promise Support npm WARN 已弃用 fs-promise@1.0.0:使用 mz 或 fs-extra^3.0 与 Promise 支持

npm WARN deprecated crypto@0.0.3: This package is no longer supported. It's now a built-in Node module. If you've depended on crypto, you should switch to the one that's built-in.


> pkcs11js@1.0.12 install /usr/local/lib/node_modules/generator-hyperledger-composer/node_modules/pkcs11js
> node-gyp rebuild

gyp ERR! configure error 

gyp ERR! stack Error: Python executable "/Users/jloo/anaconda/bin/python" is v3.5.1, which is not supported by gyp.

gyp ERR! stack You can pass the --python switch to point to Python >= v2.5.0 & < 3.0.0.

gyp ERR! stack     at PythonFinder.failPythonVersion (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:492:19)

gyp ERR! stack     at PythonFinder.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:474:14)

gyp ERR! stack     at ChildProcess.exithandler (child_process.js:264:7)

gyp ERR! stack     at ChildProcess.emit (events.js:159:13)

gyp ERR! stack     at maybeClose (internal/child_process.js:943:16)

gyp ERR! stack     at Socket.stream.socket.on (internal/child_process.js:363:11)

gyp ERR! stack     at Socket.emit (events.js:159:13)

gyp ERR! stack     at Pipe._handle.close [as _onclose] (net.js:558:12)

gyp ERR! System Darwin 17.3.0

gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"

gyp ERR! cwd /usr/local/lib/node_modules/generator-hyperledger-composer/node_modules/pkcs11js

gyp ERR! node -v v9.2.1

gyp ERR! node-gyp -v v3.6.2

gyp ERR! not ok 

npm ERR! code ELIFECYCLE

npm ERR! errno 1`enter code here`

npm ERR! pkcs11js@1.0.12 install: `node-gyp rebuild`

npm ERR! Exit status 1

npm ERR! 

npm ERR! Failed at the pkcs11js@1.0.12 install script.

npm ERR! This is probably not a problem with npm. There is likely additional logging output above

Use nvm and install Node version 8 - Stable.使用nvm并安装 Node 版本 8 - 稳定版。 And try running by using that node version.并尝试使用该节点版本运行。

Node 9 isn't supported, python 3 won't work with npm and node-gyp.不支持节点 9,python 3 不适用于 npm 和 node-gyp。 It needs to be python 2. Please see https://hyperledger.github.io/composer/stable/installing/installing-prereqs#macos to help you get the appropriate pre-reqs它需要是python 2。请参阅https://hyperledger.github.io/composer/stable/installing/installing-prereqs#macos以帮助您获得适当的pre-reqs

For me it works if I uninstall everything and install NodeJs version 8 as in:对我来说,如果我卸载所有内容并安装NodeJs版本 8,它会起作用,如下所示:

# node -v
v8.17.0
# npm -v
6.13.4

then after that install with (after apt getting node-gyp ) --unsafe-perm like:然后在安装之后(在 apt 获取node- --unsafe-perm之后) --unsafe-perm像:

npm install -g --loglevel error --unsafe-perm composer-cli

hope that helps...希望有帮助...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM