【问题标题】:node.js install web3 module scrypt issuenode.js 安装 web3 模块 scrypt 问题
【发布时间】:2019-07-09 13:28:56
【问题描述】:

我只想在我的节点中安装 web3。

我的节点版本是v8.9.4 web3版本是1.0.0-beta.46

但我不明白的是 scrypt 一直在失败。 我只是运行节点,我看到了我没有 scrypt 模块的可怕消息......

通常我只是安装我的模块而不是 -g 选项,而是 --save 一个。 但是我无法解决我的问题,所以我只使用 -g 选项安装 scrypt

# npm install -g scrypt

但是错误信息我无法理解为什么会发生在我身上?

# npm install -g scrypt

> scrypt@6.0.3 preinstall /opt/nodejs/lib/node_modules/scrypt
> node node-scrypt-preinstall.js

Error: Error: Command failed: ./configure
./configure: line 1904: config.log: Permission denied
./configure: line 1914: config.log: Permission denied


> scrypt@6.0.3 install /opt/nodejs/lib/node_modules/scrypt
> node-gyp rebuild

gyp ERR! configure error 
gyp ERR! stack Error: EACCES: permission denied, mkdir '/opt/nodejs/lib/node_modules/scrypt/build'
gyp ERR! System Linux 2.6.32-754.3.5.el6.x86_64
gyp ERR! command "/opt/nodejs/bin/node" "/opt/nodejs/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /opt/nodejs/lib/node_modules/scrypt
gyp ERR! node -v v8.9.4
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok 
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! scrypt@6.0.3 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the scrypt@6.0.3 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/2019-02-15T10_44_58_509Z-debug.log

我尝试将 web3 重新安装到我的模块中, 将显示该消息。我认为 node gyp 是这个问题的关键,所以我可以请教你为什么会出现这个问题吗?

> scrypt@6.0.3 install /home/my_apps/node/node_modules/scrypt.js/node_modules/scrypt
> node-gyp rebuild

gyp ERR! configure error 
gyp ERR! stack Error: EACCES: permission denied, mkdir '/home/my_apps/node/node_modules/scrypt.js/node_modules/scrypt/build'
gyp ERR! System Linux 2.6.32-754.3.5.el6.x86_64
gyp ERR! command "/opt/nodejs/bin/node" "/opt/nodejs/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/my_apps/node/node_modules/scrypt.js/node_modules/scrypt
gyp ERR! node -v v8.9.4
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok 

> scrypt@6.0.3 install /home/my_apps/node/node_modules/web3-eth-accounts/node_modules/scrypt.js/node_modules/scrypt
> node-gyp rebuild

gyp ERR! configure error 
gyp ERR! stack Error: EACCES: permission denied, mkdir '/home/my_apps/node/node_modules/web3-eth-accounts/node_modules/scrypt.js/node_modules/scrypt/build'
gyp ERR! System Linux 2.6.32-754.3.5.el6.x86_64
gyp ERR! command "/opt/nodejs/bin/node" "/opt/nodejs/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/my_apps/node/node_modules/web3-eth-accounts/node_modules/scrypt.js/node_modules/scrypt
gyp ERR! node -v v8.9.4
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok 
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: scrypt@6.0.3 (node_modules/scrypt.js/node_modules/scrypt):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: scrypt@6.0.3 install: `node-gyp rebuild`
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! scrypt@6.0.3 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the scrypt@6.0.3 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

【问题讨论】:

标签: node.js npm gyp scrypt


【解决方案1】:

所以我认为该错误告诉您您没有适当的文件系统访问权限来写入这些文件夹。

我的第一个想法是,您只是不允许在安装了“globals”的文件夹中写入,但在第二次尝试中,我认为您正在展示在通常的文件夹中执行此操作。 那么,当您尝试安装为 --save 时,它​​是否仍然会给您错误?它只适用于这个模块? 是否有可能获得更多写入这些文件夹的权限?

【讨论】:

  • 谢谢 Reder :) 我发现问题是 root 帐户。我已经更改了普通用户,然后问题已完全解决。我认为这是一个特殊情况。感谢您,我可以跟踪我的问题,然后终于可以解决我的问题。你拯救了我的日子谢谢你:)
  • 我在 2020 年遇到了这个问题。root 和本地用户一样失败
猜你喜欢
  • 2019-01-08
  • 1970-01-01
  • 2021-12-03
  • 2014-12-06
  • 1970-01-01
  • 1970-01-01
  • 2014-11-30
  • 2011-09-29
  • 2015-07-28
相关资源
最近更新 更多