Hyperledger教程的npm安装失败

Hyperledger教程的npm安装失败,npm,hyperledger-fabric,hyperledger,Npm,Hyperledger Fabric,Hyperledger,我目前正在使用Hyperledger Fabric重新安装Ubuntu 16.0.4。我已经从Hyperledger上取下了一套新的织物样品。我已下载以下软件: 节点版本6.9.5 npm版本3.10.10 docker版本17.03.2-ce golang版本1.7.6文档现在要求更新版本,但我认为这与此无关 我可以导航到fabcar目录,其中包含默认的npm package.json。我第一次运行./startFabric,如说明所示。然后按照说明运行npm安装。然后我得到一个错误: u@u

我目前正在使用Hyperledger Fabric重新安装Ubuntu 16.0.4。我已经从Hyperledger上取下了一套新的织物样品。我已下载以下软件:

节点版本6.9.5 npm版本3.10.10 docker版本17.03.2-ce golang版本1.7.6文档现在要求更新版本,但我认为这与此无关

我可以导航到fabcar目录,其中包含默认的npm package.json。我第一次运行./startFabric,如说明所示。然后按照说明运行npm安装。然后我得到一个错误:

u@ubmin2:~/fabric-samples/fabcar$ npm install  
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.9 install /home/u/fabric-samples/fabcar/node_modules/pkcs11js  
> npm run build  


> pkcs11js@1.0.9 build /home/u/fabric-samples/fabcar/node_modules/pkcs11js  
> node-gyp configure build  

gyp ERR! build error  
gyp ERR! stack Error: not found: make  
gyp ERR! stack     at getNotFoundError (/usr/local/node/lib/node_modules/npm/node_modules/which/which.js:14:12)  
gyp ERR! stack     at F (/usr/local/node/lib/node_modules/npm/node_modules/which/which.js:69:19)  
gyp ERR! stack     at E (/usr/local/node/lib/node_modules/npm/node_modules/which/which.js:81:29)  
gyp ERR! stack     at /usr/local/node/lib/node_modules/npm/node_modules/which/which.js:90:16  
gyp ERR! stack     at /usr/local/node/lib/node_modules/npm/node_modules/which/node_modules/isexe/index.js:44:5  
gyp ERR! stack     at /usr/local/node/lib/node_modules/npm/node_modules/which/node_modules/isexe/access.js:8:5  
gyp ERR! stack     at FSReqWrap.oncomplete (fs.js:123:15)  
gyp ERR! System Linux 4.4.0-96-generic  
gyp ERR! command "/usr/local/node/bin/node" "/usr/local/node/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "build"  
gyp ERR! cwd /home/u/fabric-samples/fabcar/node_modules/pkcs11js  
gyp ERR! node -v v6.9.5  
gyp ERR! node-gyp -v v3.4.0  
gyp ERR! not ok  

npm ERR! Linux 4.4.0-96-generic  
npm ERR! argv "/usr/local/node/bin/node" "/usr/local/node/bin/npm" "run" "build"  
npm ERR! node v6.9.5  
npm ERR! npm  v3.10.10  
npm ERR! code ELIFECYCLE  
npm ERR! pkcs11js@1.0.9 build: `node-gyp configure build`  
npm ERR! Exit status 1  
npm ERR!   
npm ERR! Failed at the pkcs11js@1.0.9 build script 'node-gyp configure build'.  
npm ERR! Make sure you have the latest version of node.js and npm installed.  
npm ERR! If you do, this is most likely a problem with the pkcs11js package,  
npm ERR! not with npm itself.  
npm ERR! Tell the author that this fails on your system:  
npm ERR!     node-gyp configure build  
npm ERR! You can get information on how to open an issue for this project with:  
npm ERR!     npm bugs pkcs11js  
npm ERR! Or if that isn't available, you can get their info via:  
npm ERR!     npm owner ls pkcs11js  
npm ERR! There is likely additional logging output above.  
npm WARN Local package.json exists, but node_modules missing, did you mean to install?
...
基于此,似乎需要包括缺少的pkcs11js模块。当我将该模块添加到package.json文件中,删除node_modules文件并重新运行npm安装时,错误转移到:

u@ubmin2:~/fabric-samples/fabcar$ npm install  
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.9 install /home/u/fabric-samples/fabcar/node_modules/pkcs11js
> npm run build  

> pkcs11js@1.0.9 build /home/u/fabric-samples/fabcar/node_modules/pkcs11js
> node-gyp configure build  

gyp ERR! build error  
gyp ERR! stack Error: not found: make  
gyp ERR! stack     at getNotFoundError (/usr/local/node/lib/node_modules/npm/node_modules/which/which.js:14:12)  
gyp ERR! stack     at F (/usr/local/node/lib/node_modules/npm/node_modules/which/which.js:69:19)  
gyp ERR! stack     at E (/usr/local/node/lib/node_modules/npm/node_modules/which/which.js:81:29)  
gyp ERR! stack     at /usr/local/node/lib/node_modules/npm/node_modules/which/which.js:90:16  
gyp ERR! stack     at /usr/local/node/lib/node_modules/npm/node_modules/which/node_modules/isexe/index.js:44:5  
gyp ERR! stack     at /usr/local/node/lib/node_modules/npm/node_modules/which/node_modules/isexe/access.js:8:5  
gyp ERR! stack     at FSReqWrap.oncomplete (fs.js:123:15)  
gyp ERR! System Linux 4.4.0-96-generic  
gyp ERR! command "/usr/local/node/bin/node" "/usr/local/node/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "build"  
gyp ERR! cwd /home/u/fabric-samples/fabcar/node_modules/pkcs11js  
gyp ERR! node -v v6.9.5  
gyp ERR! node-gyp -v v3.4.0  
gyp ERR! not ok  

npm ERR! Linux 4.4.0-96-generic  
npm ERR! argv "/usr/local/node/bin/node" "/usr/local/node/bin/npm" "run" "build"  
npm ERR! node v6.9.5  
npm ERR! npm  v3.10.10  
npm ERR! code ELIFECYCLE  
npm ERR! pkcs11js@1.0.9 build: `node-gyp configure build`  
npm ERR! Exit status 1  
npm ERR!  
npm ERR! Failed at the pkcs11js@1.0.9 build script 'node-gyp configure build'.  
npm ERR! Make sure you have the latest version of node.js and npm installed.  
npm ERR! If you do, this is most likely a problem with the pkcs11js package,  
npm ERR! not with npm itself.  
npm ERR! Tell the author that this fails on your system:  
npm ERR!     node-gyp configure build  
npm ERR! You can get information on how to open an issue for this project with:  
npm ERR!     npm bugs pkcs11js  
npm ERR! Or if that isn't available, you can get their info via:  
npm ERR!     npm owner ls pkcs11js  
npm ERR! There is likely additional logging output above.  
npm WARN Local package.json exists, but node_modules missing, did you mean to install?  

npm ERR! Please include the following file with any support request:  
npm ERR!     /home/u/fabric-samples/fabcar/node_modules/pkcs11js/npm-debug.log  
fabcar@1.0.0 /home/u/fabric-samples/fabcar
...  
有人知道为什么npm安装无法按预期运行吗

---更新--- 作为对christo4ferris的回应,对不起,我也应该证明这一点。我试过很多方法,包括安装和拆卸make。安装make时,仍会出现错误:

npm WARN fabcar@1.0.0 No repository field.
npm ERR! Linux 4.4.0-96-generic
npm ERR! argv "/usr/local/node/bin/node" "/usr/local/node/bin/npm" "install"
npm ERR! node v6.9.5
npm ERR! npm  v3.10.10
npm ERR! path /home/u/fabric-samples/fabcar/node_modules
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall access

npm ERR! Error: EACCES: permission denied, access '/home/u/fabric-samples/fabcar/node_modules'
npm ERR!     at Error (native)
npm ERR!  { Error: EACCES: permission denied, access '/home/u/fabric-samples/fabcar/node_modules'
npm ERR!     at Error (native)
npm ERR!   errno: -13,
npm ERR!   code: 'EACCES',
npm ERR!   syscall: 'access',
npm ERR!   path: '/home/u/fabric-samples/fabcar/node_modules' }
npm ERR! 
npm ERR! Please try running this command again as root/Administrator.

npm ERR! Please include the following file with any support request:
npm ERR!     /home/u/fabric-samples/fabcar/npm-debug.log
然后,当我以sudo身份运行以root身份运行时,会收到以下错误消息:

root@ubmin2:/home/u/fabric-samples/fabcar# npm install
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.9 install /home/u/fabric-samples/fabcar/node_modules/pkcs11js
> npm run build


> pkcs11js@1.0.9 build /home/u/fabric-samples/fabcar/node_modules/pkcs11js
> node-gyp configure build

gyp WARN EACCES user "root" does not have permission to access the dev dir "/root/.node-gyp/6.9.5"
gyp WARN EACCES attempting to reinstall using temporary dev dir "/home/u/fabric-samples/fabcar/node_modules/pkcs11js/.node-gyp"
make: Entering directory '/home/u/fabric-samples/fabcar/node_modules/pkcs11js/build'
  CXX(target) Release/obj.target/pkcs11/src/main.o
make: g++: Command not found
pkcs11.target.mk:107: recipe for target 'Release/obj.target/pkcs11/src/main.o' failed
make: *** [Release/obj.target/pkcs11/src/main.o] Error 127
make: Leaving directory '/home/u/fabric-samples/fabcar/node_modules/pkcs11js/build'
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/local/node/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:276:23)
gyp ERR! stack     at emitTwo (events.js:106:13)
gyp ERR! stack     at ChildProcess.emit (events.js:191:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12)
gyp ERR! System Linux 4.4.0-96-generic
gyp ERR! command "/usr/local/node/bin/node" "/usr/local/node/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "build"
gyp ERR! cwd /home/u/fabric-samples/fabcar/node_modules/pkcs11js
gyp ERR! node -v v6.9.5
gyp ERR! node-gyp -v v3.4.0
gyp ERR! not ok 

npm ERR! Linux 4.4.0-96-generic
npm ERR! argv "/usr/local/node/bin/node" "/usr/local/node/bin/npm" "run" "build"
npm ERR! node v6.9.5
npm ERR! npm  v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! pkcs11js@1.0.9 build: `node-gyp configure build`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the pkcs11js@1.0.9 build script 'node-gyp configure build'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the pkcs11js package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-gyp configure build
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs pkcs11js
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls pkcs11js
npm ERR! There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?

npm ERR! Please include the following file with any support request:
npm ERR!     /home/u/fabric-samples/fabcar/node_modules/pkcs11js/npm-debug.log
fabcar@1.0.0 /home/u/fabric-samples/fabcar

谢谢。

问题是我缺少了一个必要的C++编译器。它似乎没有包含在Ubuntu的最小安装中,这是有道理的,但错误似乎非常不透明。运行sudo-apt-install-build-essential g++似乎解决了这个问题


我不确定是否有必要,但我还需要将别名sudo='sudo env PATH=$PATH'添加到我的.bashrc文件中,以便可以使用sudo运行npm。这个解决方案来自.

问题是我缺少了一个必要的C++编译器。它似乎没有包含在Ubuntu的最小安装中,这是有道理的,但错误似乎非常不透明。运行sudo-apt-install-build-essential g++似乎解决了这个问题


我不确定是否有必要,但我还需要将别名sudo='sudo env PATH=$PATH'添加到我的.bashrc文件中,以便可以使用sudo运行npm。该解决方案来自。

不确定这是否是正确的解决方案。。。我有最新的编译器,但仍然失败,并出现相同的错误。不确定这是否是正确的修复。。。我有最新的编译器,但它仍然失败,并出现相同的错误。