简体   繁体   English

node.js安装web3模块scrypt问题

[英]node.js install web3 module scrypt issue

All I want is to install web3 in my node. 我要做的就是在节点中安装web3。

My node version is v8.9.4 web3 version is 1.0.0-beta.46 我的节点版本是v8.9.4,web3版本是1.0.0-beta.46

But what I don't understand is that the scrypt keeps failing. 但是我不明白的是,scrypt一直在失败。 I just run the node, I see the terrible message that no scrypt module I have... 我只是运行节点,我看到了可怕的消息,说我没有scrypt模块...

Usually I just install my module not -g option but --save one. 通常我只安装我的模块,而不是-g选项而是--save一个。 However I can't solve my problem so I just install scrypt with -g option 但是我不能解决我的问题,所以我只用-g选项安装scrypt

# npm install -g scrypt

But the error message I cannot understand why it happen to me? 但是错误消息我无法理解为什么会发生在我身上?

# 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

I try to reinstall web3 into my module, The message will be shown. 我尝试将web3重新安装到我的模块中,将显示该消息。 I think node gyp is the key to this problem, so can I ask you for advice on why this problem is happening? 我认为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.

So I think the error tells you that you don't have proper access to the file system to write into those folders. 因此,我认为该错误告诉您,您无权访问文件系统以写入那些文件夹。

My first thought was, that you're just not allowed to write in the folder where the 'globals' are installed, but in the second try I think you're showing to do it in your usual folder. 我的第一个想法是,只允许您在安装了“ globals”的文件夹中写东西,但是在第二次尝试中,我认为您正在显示要在通常的文件夹中写东西。 So, when you try to install as --save, does it still give you the error? 因此,当您尝试以--save进行安装时,它仍然会给您错误吗? And it's only for this module? 它仅用于此模块吗? Is it possible that you can gain more rights to write into these folders? 您是否有可能获得更多写入这些文件夹的权限?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM