【问题标题】:pkcs11js@1.0.19 script failure installing Hyperledger Caliper CLI from NPM v0.2.0从 NPM v0.2.0 安装 Hyperledger Caliper CLI 的 pkcs11js@1.0.19 脚本失败
【发布时间】:2020-04-29 16:56:50
【问题描述】:

我正在尝试从 npm 安装 Hyperledger Caliper CLI。
但是,无法将 sut、fabric SDK 与卡尺绑定。它显示以下 -

2020.01.12-19:29:43.747 info  [caliper] [bind]  Calling npm with: install grpc@1.14.2 fabric-ca-client@1.4.4 fabric-client@1.4.4 fabric-protos@2.0.0-snapshot.1 fabric-network@1.4.4
npm WARN deprecated hoek@4.2.1: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).

> pkcs11js@1.0.19 install /home/necos/caliper/caliper-benchmarks/node_modules/pkcs11js
> node-gyp rebuild

gyp WARN EACCES current user ("necos") does not have permission to access the dev dir "/root/.cache/node-gyp/8.10.0"
gyp WARN EACCES attempting to reinstall using temporary dev dir "/home/necos/caliper/caliper-benchmarks/node_modules/pkcs11js/.node-gyp"
gyp WARN install got an error, rolling back install
gyp WARN install got an error, rolling back install
gyp ERR! configure error 
gyp ERR! stack Error: EACCES: permission denied, mkdir '/home/necos/caliper/caliper-benchmarks/node_modules/pkcs11js/.node-gyp'
gyp ERR! System Linux 4.15.0-74-generic
gyp ERR! command "/usr/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/necos/caliper/caliper-benchmarks/node_modules/pkcs11js
gyp ERR! node -v v8.10.0
gyp ERR! node-gyp -v v5.0.5
gyp ERR! not ok 
npm WARN notsup Unsupported engine for fabric-protos@2.0.0-snapshot.1: wanted: {"node":"^8.9.0","npm":"^5.5.1"} (current: {"node":"8.10.0","npm":"6.13.6"})
npm WARN notsup Not compatible with your version of node/npm: fabric-protos@2.0.0-snapshot.1

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! pkcs11js@1.0.19 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the pkcs11js@1.0.19 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!     /root/.npm/_logs/2020-01-12T22_30_01_834Z-debug.log
2020.01.12-19:30:01.898 error [caliper] [bind]  Failed to execute "npm" with return code 1.
Error: Failed to execute "npm" with return code 1.
    at ChildProcess.proc.on (/home/necos/caliper/caliper-benchmarks/node_modules/@hyperledger/caliper-cli/lib/utils/cmdutils.js:56:35)
    at emitTwo (events.js:126:13)
    at ChildProcess.emit (events.js:214:7)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
Command failed

我尝试了 node-gyp 重建,但似乎没有用。 任何人都可以澄清这里发生了什么?

安装环境:
服务器上的 Ubuntu 仿生,
NodeJS v8.10
节点-gyp v6.1.0
节点预gyp v0.14.0
Docker v19.03.1
Docker-compose v0.19.20

【问题讨论】:

    标签: npm hyperledger-fabric blockchain hyperledger-caliper


    【解决方案1】:

    这是问题的根源:

    gyp WARN EACCES current user ("necos") does not have permission to access the dev dir "/root/.cache/node-gyp/8.10.0
    

    Caliper 安装指南包含此问题的解决方法: https://hyperledger.github.io/caliper/vLatest/installing-caliper/#installing-from-npm

    以上内容的灵感来自于针对同一问题的官方 NPM 指南: https://docs.npmjs.com/resolving-eacces-permissions-errors-when-installing-packages-globally

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2019-07-17
      • 1970-01-01
      • 2021-04-11
      • 2018-11-07
      • 1970-01-01
      • 1970-01-01
      • 2020-06-08
      相关资源
      最近更新 更多