npm 安装结构 CA 客户端失败



我们在尝试安装最新的 NodeJs fabric-ca-client 时,在 CentOS 7.3 和 RHEL 7.3 上都遇到了问题

以下是完整列表:

sudo npm install -g fabric-ca-client@1.0.0
> x509@0.3.2 install /usr/lib/node_modules/fabric-ca-client/node_modules/x509
> node-gyp rebuild
gyp ERR! clean error
gyp ERR! stack Error: EACCES: permission denied, rmdir 'build'
gyp ERR! stack     at Error (native)
gyp ERR! System Linux 3.10.0-514.el7.x86_64
gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /usr/lib/node_modules/fabric-ca-client/node_modules/x509
gyp ERR! node -v v6.11.0
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! x509@0.3.2 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the x509@0.3.2 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/2017-07-19T14_02_06_503Z-debug.log

2017-07-19T14_02_06_503Z-debug.log 中的列表包含以下内容:

1666 silly install x509@0.3.2
1667 info lifecycle x509@0.3.2~install: x509@0.3.2
1668 verbose lifecycle x509@0.3.2~install: unsafe-perm in lifecycle false
1669 verbose lifecycle x509@0.3.2~install: PATH: /usr/lib/node_modules/npm/bin/node-gyp-bin:/usr/lib/node_modules/fabric-ca-client/node_modules/x509/node_modules/.bin:/usr/lib/node_modules/fabric-ca-client/node_modules/.bin:/usr/lib/node_modules/.bin:/sbin:/bin:/usr/sbin:/usr/bin
1670 verbose lifecycle x509@0.3.2~install: CWD: /usr/lib/node_modules/fabric-ca-client/node_modules/x509
1671 silly lifecycle x509@0.3.2~install: Args: [ '-c', 'node-gyp rebuild' ]
1672 silly lifecycle x509@0.3.2~install: Returned: code: 1  signal: null
1673 info lifecycle x509@0.3.2~install: Failed to exec install script
1674 verbose unlock done using /root/.npm/_locks/staging-a072192f34a17023.lock for /usr/lib/node_modules/.staging
1675 verbose stack Error: x509@0.3.2 install: `node-gyp rebuild`
1675 verbose stack Exit status 1
1675 verbose stack     at EventEmitter.<anonymous> (/usr/lib/node_modules/npm/lib/utils/lifecycle.js:289:16)
1675 verbose stack     at emitTwo (events.js:106:13)
1675 verbose stack     at EventEmitter.emit (events.js:191:7)
1675 verbose stack     at ChildProcess.<anonymous> (/usr/lib/node_modules/npm/lib/utils/spawn.js:40:14)
1675 verbose stack     at emitTwo (events.js:106:13)
1675 verbose stack     at ChildProcess.emit (events.js:191:7)
1675 verbose stack     at maybeClose (internal/child_process.js:891:16)
1675 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
1676 verbose pkgid x509@0.3.2
1677 verbose cwd /home/ibmuser
1678 verbose Linux 3.10.0-514.el7.x86_64
1679 verbose argv "/usr/bin/node" "/bin/npm" "install" "-g" "fabric-ca-client@1.0.0"
1680 verbose node v6.11.0
1681 verbose npm  v5.3.0
1682 error code ELIFECYCLE
1683 error errno 1
1684 error x509@0.3.2 install: `node-gyp rebuild`
1684 error Exit status 1
1685 error Failed at the x509@0.3.2 install script.
1685 error This is probably not a problem with npm. There is likely additional logging output above.

任何帮助非常感谢。提前感谢!

由于依赖包 x509 https://github.com/Southern/node-x509/issues/49 中的已知 isue,似乎 NodeJs 包 fabric-ca-client 版本 1.0.0 无法由 root 全局安装,但它可以本地安装在具有有效 package.json 的 NodeJs 源文件夹中。

最新更新