【发布时间】:2018-09-23 20:09:54
【问题描述】:
当我尝试在 hyperledger 中运行enrollAdmin.js 时,我一直面临这个错误
Error: Cannot find module 'Downloads\Hyperledger\fabric-samples-release-1.2\fabcar\node_modules\fabric-client\node_modules\grpc\src\node\extension_binary\node-v64-win32-x64-unknown\grpc_node.node'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:581:15)
at Function.Module._load (internal/modules/cjs/loader.js:507:25)
at Module.require (internal/modules/cjs/loader.js:637:17)
at require (internal/modules/cjs/helpers.js:20:18)
at Object.<anonymous> (Downloads\Hyperledger\fabric-samples-release-1.2\fabcar\node_modules\fabric-client\node_modules\grpc\src\grpc_extension.js:32:13)
at Module._compile (internal/modules/cjs/loader.js:689:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
at Module.load (internal/modules/cjs/loader.js:599:32)
at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
at Function.Module._load (internal/modules/cjs/loader.js:530:3)
我能够在我的文件目录中找到该文件,但由于某种原因,当我运行代码时无法找到该模块。
我已经多次运行 npm install 以及 npm install grpc,但这似乎并没有解决问题。请指教
我在文件上运行了第一个 npm install,这是 msg
Downloads\Hyperledger\fabric-samples-release-1.2\fabcar\node_modules\grpc\src\node\extension_binary>npm install
npm WARN deprecated node-uuid@1.4.8: Use uuid module instead
npm WARN deprecated hoek@2.16.3: The major version is no longer supported. Please update to 4.x or newer
> grpc@1.15.1 install Downloads\Hyperledger\fabric-samples-release-1.2\fabcar\node_modules\grpc
> node-pre-gyp install --fallback-to-build --library=static_library
node-pre-gyp WARN Using request for node-pre-gyp https download
[grpc] Success: "Downloads\Hyperledger\fabric-samples-release-1.2\fabcar\node_modules\grpc\src\node\extension_binary\node-v64-win32-x64-unknown\grpc_node.node" already installed
Pass --update-binary to reinstall or --build-from-source to recompile
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN The package lodash is included as both a dev and production dependency.
added 225 packages from 555 contributors and audited 655 packages in 62.783s
found 16 vulnerabilities (1 low, 14 moderate, 1 critical)
run `npm audit fix` to fix them, or `npm audit` for details
之后我也进行了重建
文件 grpc_node.node 已创建,但找不到模块时遇到同样的错误。
更新 我意识到扩展参考是不同的
Downloads\Hyperledger\fabric-samples-release-1.2\fabcar\node_modules\fabric-client\node_modules\grpc\src\node\extension_binary\node-v64-win32-x64-unknown
因此重新运行 npm install 并遇到此错误
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-win32-x64-unknown.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for grpc@1.10.1 and node@10.10.0 (node-v64 ABI, unknown) (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.10.0 (node-v64 ABI, unknown) (falling back to source compile with node-gyp)
node-pre-gyp ERR! Hit error Connection closed while downloading tarball file
【问题讨论】:
标签: node.js docker npm hyperledger-fabric hyperledger