Search code examples
node.jsblockchainhyperledger-composer

Unable to install composer rest server


I'm trying to install composer rest server in my macOS and im getting errors. How do I resolve these errors and install composer rest server ?

I was reading this article and learning how to implement Composer Blockchain network. When I run

npm install -g composer-rest-server

I'm getting following error

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

My node version 9.4.0 npm version 5.6.0

Is it compulsory to install xcode to run this code ? Please tell the significance of xcode to run composer


Solution

  • This issue occurred because node v9.x.x is not supported by hyperledger composer tools.

    So, you have to use node v8.x.x.

    Steps: Link

    Also install Xcode Command Line Tools.

    Steps: Link