由于g ++无法在ubuntu上安装hyperledger composer-cli

时间:2019-04-05 09:13:10

标签: hyperledger-composer

在ubuntu 18.04上,尝试按以下说明安装超级账本本地开发环境时出现错误: https://ibm-blockchain.github.io/develop/installing/development-tools.html。 它告诉我它不知道g ++命令。

我的配置清单:

npm: v6.9.0
docker: 18.x
docker-compose: 1.24
node: 10.15.3 (also tried with v11.10.0 and 8.9)
npm: 6.4.1
git: 2.17.1
Python 2.7.14

运行“ npm install -g composer-cli”后出现错误日志:

npm WARN deprecated core-js@2.3.0: core-js@<2.6.5 is no longer maintained. Please, upgrade to core-js@3 or at least to actual version of core-js@2.
/home/myuser/.nvm/versions/node/v8.15.1/bin/composer -> /home/myuser   /.nvm/versions/node/v8.15.1/lib/node_modules/composer-cli/cli.js

> dtrace-provider@0.8.7 install /home/myuser/.nvm/versions/node/v8.15.1/lib/node_modules/composer-cli/node_modules/dtrace-provider
> node-gyp rebuild || node suppress-error.js

make: Verzeichnis „/home/myuser/.nvm/versions/node/v8.15.1/lib/node_modules/composer-cli/node_modules/dtrace-provider/build“ wird betreten
TOUCH Release/obj.target/DTraceProviderStub.stamp
make: Verzeichnis „/home/myuser/.nvm/versions/node/v8.15.1/lib/node_modules/composer-cli/node_modules/dtrace-provider/build“ wird verlassen

> node-report@2.2.1 install /home/myuser/.nvm/versions/node/v8.15.1/lib/node_modules/composer-cli/node_modules/node-report
> node-gyp rebuild

make: Verzeichnis „/home/myuser/.nvm/versions/node/v8.15.1/lib/node_modules/composer-cli/node_modules/node-report/build“ wird betreten
CXX(target) Release/obj.target/api/src/node_report.o
make: g++: Command not found
api.target.mk:107: recipe for target 'Release/obj.target/api/src/node_report.o' failed
make: *** [Release/obj.target/api/src/node_report.o] Error 127
make: Verzeichnis „/home/myuser/.nvm/versions/node/v8.15.1/lib/node_modules/composer-cli/node_modules/node-report/build“ wird verlassen
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/home/myuser/.nvm/versions/node/v8.15.1/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:258:23)
gyp ERR! stack     at emitTwo (events.js:126:13)
gyp ERR! stack     at ChildProcess.emit (events.js:214:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
gyp ERR! System Linux 4.15.0-47-generic
gyp ERR! command "/home/myuser/.nvm/versions/node/v8.15.1/bin/node" "/home/myuser/.nvm/versions/node/v8.15.1/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/myuser/.nvm/versions/node/v8.15.1/lib/node_modules/composer-cli/node_modules/node-report
gyp ERR! node -v v8.15.1
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok 
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.7 (node_modules/composer-cli/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.7: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-report@2.2.1 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the node-report@2.2.1 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!     /home/myuser/.npm/_logs/2019-04-05T08_35_08_242Z-debug.log

1 个答案:

答案 0 :(得分:0)

检查您的节点和npm版本。以下是要求:

节点:8.9或更高版本(注意不支持版本9)
npm:v5.x

我同时拥有并能够在Ubuntu 18上成功安装它。