2

我一直在尝试安装和运行我的第一个超级账本结构应用程序(http://hyperledger-fabric.readthedocs.io/en/latest/write_first_app.html),但每次运行“npm install”命令时都会遇到以下问题. 请让我知道解决此问题的解决方案是什么。版本是: { fabcar: '1.0.0', npm: '5.6.0', ares: '1.14.0', cldr: '33.1', http_parser: '2.8.0', icu: '62.1', modules :'64',napi:'3',nghttp2:'1.32.0',节点:'10.8.0',openssl:'1.1.0h',tz:'2018e',unicode:'11.0',uv:' 1.22.0',v8:'6.7.288.49-node.19',zlib:'1.2.11'}

错误如下:

vinusha@vinusha-VirtualBox:~/fabric-samples/fabcar$ npm install
npm WARN npm npm does not support Node.js v10.8.0
npm WARN npm You should probably upgrade to a newer version of node as we
npm WARN npm can't make any promises that npm will work with this version.
npm WARN npm Supported releases of Node.js are the latest release of 4, 6, 7, 8, 9.
npm WARN npm You can find the latest version at https://nodejs.org/

grpc@1.10.1 install /home/vinusha/fabric-samples/fabcar/node_modules/fabric-client/node_modules/grpc node-pre-gyp install --fallback-to-build --library=static_library

node-pre-gyp ERR! **Tried to download(403): https://storage.googleapis.com/grpc-precompiled-binaries/node/grpc/v1.10.1/node-v64-linux-x64-glibc.tar.gz 
node-pre-gyp ERR! Pre-built binaries not found for grpc@1.10.1 and node@10.8.0 (node-v64 ABI, glibc) (falling back to source compile with node-gyp) 
node-pre-gyp ERR! Pre-built binaries not installable for grpc@1.10.1 and node@10.8.0 (node-v64 ABI, glibc) (falling back to source compile with node-gyp) 
node-pre-gyp ERR! Hit error Connection closed while downloading tarball file** 
make: Entering directory '/home/vinusha/fabric-samples/fabcar/node_modules/fabric-client/node_modules/grpc/build'
make: Entering directory '/home/vinusha/fabric-samples/fabcar/node_modules/fabric-client/node_modules/grpc/build'
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/surface/init.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/surface/init.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/avl/avl.o
rm: cannot remove './Release/.deps/Release/obj.target/grpc/deps/grpc/src/core/lib/surface/init.o.d.raw': No such file or directory
grpc.target.mk:388: recipe for target 

'Release/obj.target/grpc/deps/grpc/src/core/lib/surface/init.o' failed
make: *** [Release/obj.target/grpc/deps/grpc/src/core/lib/surface/init.o] Error 1
make: Leaving directory '/home/vinusha/fabric-samples/fabcar/node_modules/fabric-client/node_modules/grpc/build'
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:258:23)
gyp ERR! stack     at ChildProcess.emit (events.js:182:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:238:12)
gyp ERR! System Linux 4.15.0-30-generic
gyp ERR! command "/usr/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--library=static_library" "--module=/home/vinusha/fabric-samples/fabcar/node_modules/fabric-client/node_modules/grpc/src/node/extension_binary/node-v64-linux-x64-glibc/grpc_node.node" "--module_name=grpc_node" "--module_path=/home/vinusha/fabric-samples/fabcar/node_modules/fabric-client/node_modules/grpc/src/node/extension_binary/node-v64-linux-x64-glibc"
gyp ERR! cwd /home/vinusha/fabric-samples/fabcar/node_modules/fabric-client/node_modules/grpc
gyp ERR! node -v v10.8.0
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok 
node-pre-gyp ERR! build error 
node-pre-gyp ERR! stack Error: Failed to execute '/usr/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --library=static_library --module=/home/vinusha/fabric-samples/fabcar/node_modules/fabric-client/node_modules/grpc/src/node/extension_binary/node-v64-linux-x64-glibc/grpc_node.node --module_name=grpc_node --module_path=/home/vinusha/fabric-samples/fabcar/node_modules/fabric-client/node_modules/grpc/src/node/extension_binary/node-v64-linux-x64-glibc' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/home/vinusha/fabric-samples/fabcar/node_modules/fabric-client/node_modules/grpc/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:182:13)
node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:962:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:249:5)
node-pre-gyp ERR! System Linux 4.15.0-30-generic
node-pre-gyp ERR! command "/usr/bin/node" "/home/vinusha/fabric-samples/fabcar/node_modules/fabric-client/node_modules/grpc/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build" "--library=static_library"
node-pre-gyp ERR! cwd /home/vinusha/fabric-samples/fabcar/node_modules/fabric-client/node_modules/grpc
node-pre-gyp ERR! node -v v10.8.0
node-pre-gyp ERR! node-pre-gyp -v v0.7.0
node-pre-gyp ERR! not ok 
Failed to execute '/usr/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --library=static_library --module=/home/vinusha/fabric-samples/fabcar/node_modules/fabric-client/node_modules/grpc/src/node/extension_binary/node-v64-linux-x64-glibc/grpc_node.node --module_name=grpc_node --module_path=/home/vinusha/fabric-samples/fabcar/node_modules/fabric-client/node_modules/grpc/src/node/extension_binary/node-v64-linux-x64-glibc' (1)
npm WARN fabcar@1.0.0 No repository field.

npmsh: 0: getcwd() failed: No such file or directory
/bin/sh: 1: cannot create ./Release/.deps/Release/obj.target/grpc/deps/grpc/src/core/lib/avl/avl.o.d: Directory nonexistent
grpc.target.mk:388: recipe for target 'Release/obj.target/grpc/deps/grpc/src/core/lib/avl/avl.o' failed
make: *** [Release/obj.target/grpc/deps/grpc/src/core/lib/avl/avl.o] Error 2
make: Leaving directory '/home/vinusha/fabric-samples/fabcar/node_modules/fabric-client/node_modules/grpc/build'
gyp  ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! grpc@1.10.1 install: `node-pre-gyp install --fallback-to-build --library=static_library`
npm ERR!ERR! Exit status 1
npm ERR!  
npmbuild error 
gyp ERR! Failed at the grpc@1.10.1 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
 ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:258:23)
gyp ERR! stack     at ChildProcess.emit (events.js:182:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:238:12)
gyp ERR! System Linux 4.15.0-30-generic
gyp ERR! command "/usr/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--library=static_library" "--module=/home/vinusha/fabric-samples/fabcar/node_modules/fabric-client/node_modules/grpc/src/node/extension_binary/node-v64-linux-x64-glibc/grpc_node.node" "--module_name=grpc_node" "--module_path=/home/vinusha/fabric-samples/fabcar/node_modules/fabric-client/node_modules/grpc/src/node/extension_binary/node-v64-linux-x64-glibc"
gyp ERR! cwd /home/vinusha/fabric-samples/fabcar/node_modules/fabric-client/node_modules/grpc
gyp ERR! node -v v10.8.0
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok 
4

2 回答 2

1

刚刚设法让“npm install”工作。这里的主要错误是我使用的 nodejs 版本是 10.8.0,而 hyperledger 要求 nodejs 版本小于 9。

我卸载了 nodejs 和 npm 并重新安装了 8.11.3 版本。此后,在安装 node 和 npm 后,运行“hash -r”很重要,以防 npm 版本未显示。

于 2018-08-14T22:01:16.220 回答
-1

If what I saw in your first code is what you really typed, then I would say that while using npm install that the name of the package is attached to it like this npm install lodash, not only npm install. So in your own case you have to append the two files you need which would be npm install fabric-ca-client and also npm install fabric-client.

于 2018-08-14T20:38:42.257 回答