簡體   English   中英

node.js安裝web3模塊scrypt問題

[英]node.js install web3 module scrypt issue

我要做的就是在節點中安裝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.

因此,我認為該錯誤告訴您,您無權訪問文件系統以寫入那些文件夾。

我的第一個想法是,只允許您在安裝了“ globals”的文件夾中寫東西,但是在第二次嘗試中,我認為您正在顯示要在通常的文件夾中寫東西。 因此,當您嘗試以--save進行安裝時,它仍然會給您錯誤嗎? 它僅用於此模塊嗎? 您是否有可能獲得更多寫入這些文件夾的權限?

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM