无法安装作曲家休息服务器

Unable to install composer rest server

我正在尝试在我的 macOS 中安装 composer rest 服务器,但我遇到了错误。如何解决这些错误并安装 composer rest 服务器?

我正在阅读 this 文章并学习如何实施 Composer 区块链网络。 当我运行

npm install -g composer-rest-server

我遇到以下错误

AttributeError: 'NoneType' object has no attribute 'groups'
gyp ERR! configure error 
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (/Users/pc/.nvm/versions/node/v9.4.0/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:336:16)
gyp ERR! stack     at ChildProcess.emit (events.js:160:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:209:12)
gyp ERR! System Darwin 18.2.0
gyp ERR! command "/Users/pc/.nvm/versions/node/v9.4.0/bin/node" "/Users/pc/.nvm/versions/node/v9.4.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/pc/.nvm/versions/node/v9.4.0/lib/node_modules/composer-rest-server/node_modules/pkcs11js
gyp ERR! node -v v9.4.0
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok 
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! pkcs11js@1.0.17 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the pkcs11js@1.0.17 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/pc/.npm/_logs/2019-05-10T06_00_02_075Z-debug.log

我的节点版本9.4.0 npm 版本 5.6.0

是否必须安装 xcode 至 运行 此代码?请告诉xcode对运行作曲家

的意义

出现此问题是因为 hyperledger composer tools 不支持 node v9.x.x

所以,你必须使用node v8.x.x

步骤:

同时安装 Xcode Command Line Tools.

步骤:Link