Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/google-chrome/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
无法在ubuntu 18.04中安装web3_Ubuntu_Npm_Ethereum_Web3 - Fatal编程技术网

无法在ubuntu 18.04中安装web3

无法在ubuntu 18.04中安装web3,ubuntu,npm,ethereum,web3,Ubuntu,Npm,Ethereum,Web3,我使用以下命令在ubuntu 18.04中安装web3.js: sudo npm install -g web3 并得到以下错误: > scrypt@6.0.3 preinstall /usr/local/lib/node_modules/web3/node_modules/scrypt > node node-scrypt-preinstall.js Error: Error: Command failed: ./configure ./configure: line 1904

我使用以下命令在ubuntu 18.04中安装web3.js:

sudo npm install -g web3
并得到以下错误:

> scrypt@6.0.3 preinstall /usr/local/lib/node_modules/web3/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 /usr/local/lib/node_modules/web3/node_modules/scrypt
> node-gyp rebuild

gyp ERR! configure error 
gyp ERR! stack Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/web3/node_modules/scrypt/build'
gyp ERR! System Linux 4.15.0-45-generic
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /usr/local/lib/node_modules/web3/node_modules/scrypt
gyp ERR! node -v v10.15.1
gyp ERR! node-gyp -v v3.8.0
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!     /home/chakshu/.npm/_logs/2019-03-08T15_40_18_402Z-debug.log
虽然“sudo npm安装-gweb3@0.20.7“工作正常,但我希望更新web3.js。 请帮忙

希望这有帮助

sudo npm install--save web3--unsafe perm=true--allow root

@,您的解决方案对大多数软件包都可以正常工作,但在我尝试安装时无法正常工作。
现在我找到了根本原因。我在Ubuntu18.04中安装了Nodejs,它在许多NPM软件包中显示了上述错误,如。因此,我从系统中完全卸载了Nodejs和npm,并使用apt-get-package-manager再次安装了它,即,
sudo-apt-install-Nodejs-npm
。现在一切正常,没有任何问题。

是的,它工作正常。谢谢p、 s:要全局安装并且不在package.json中保留记录,请使用“sudo npm install-g web3--unsafe perm=true--allow root”。