2017-10-03 1 views
0

현재 Hyperledger Fabric을 사용하여 최소한의 우분투 16.0.4 설치 작업을하고 있습니다. 나는 Hyperledger documentation site에서 원단 샘플을 새로 설치했습니다. 나는 다음과 같은 소프트웨어를 다운로드 한 :Hyperledger 자습서에 대한 npm 설치가 실패했습니다

노드 버전 6.9.5
NPM 버전 3.10.10
고정 표시기 버전 17.03.2-CE
golang 버전 1.7.6 (이제 문서에 새 버전을 요구하지만, 내 생각 이것은 관련이 없습니다)

기본 npm package.json을 포함하는 fabcar 디렉토리로 이동할 수 있습니다. 지침에 표시된대로 ./startFabric을 먼저 실행합니다. 그런 다음 지침에 따라 npm install을 실행합니다. 그런 다음 오류가 발생합니다.

[email protected]:~/fabric-samples/fabcar$ npm install 
npm WARN deprecated [email protected]: 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. 

> [email protected] install /home/u/fabric-samples/fabcar/node_modules/pkcs11js 
> npm run build 


> [email protected] 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! [email protected] build: `node-gyp configure build` 
npm ERR! Exit status 1 
npm ERR! 
npm ERR! Failed at the [email protected] 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 설치,"NPM 예상대로 실행에 실패한 설치 이유

[email protected]:~/fabric-samples/fabcar$ npm install 
npm WARN deprecated [email protected]: 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. 

> [email protected] install /home/u/fabric-samples/fabcar/node_modules/pkcs11js 
> npm run build 

> [email protected] 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! [email protected] build: `node-gyp configure build` 
npm ERR! Exit status 1 
npm ERR! 
npm ERR! Failed at the [email protected] 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 
[email protected] /home/u/fabric-samples/fabcar 
... 

사람이 이해 하는가를?

------ 업데이트 ------ christo4ferris 님의 질문에 답변 죄송합니다. 나는 make를 설치하고 제거하는 것을 포함하여 많은 것을 시도했다. 내가 만드는 설치할 때, 나는 여전히 오류가 발생합니다 :

npm WARN [email protected] 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 us로 실행할 때, 나는이 오류 메시지가 :

[email protected]:/home/u/fabric-samples/fabcar# npm install 
npm WARN deprecated [email protected]: 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. 

> [email protected] install /home/u/fabric-samples/fabcar/node_modules/pkcs11js 
> npm run build 


> [email protected] 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! [email protected] build: `node-gyp configure build` 
npm ERR! Exit status 1 
npm ERR! 
npm ERR! Failed at the [email protected] 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 
[email protected] /home/u/fabric-samples/fabcar 

감사합니다.

답변

3

문제점은 필요한 C++ 컴파일러가 누락되었습니다. Ubuntu 최소 설치에는 포함되지 않았지만 오류는 매우 불투명 한 것으로 보입니다. Running sudo apt install build-essential g++이 문제를 해결 한 것으로 보입니다.

필요한 경우 확실하지 않지만 sudo로 npm을 실행할 수 있도록 을 .bashrc 파일에 추가해야했습니다. 그 해결책은 this link에서 왔습니다.