невозможно установить web3 в Ubuntu 18.04 - PullRequest
0 голосов
/ 08 марта 2019

Я устанавливаю web3.js в Ubuntu 18.04 с помощью следующей команды:

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 install -g web3@0.20".7 "работает нормально, но я хочу обновить web3.js.Пожалуйста, помогите!

Ответы [ 2 ]

0 голосов
/ 26 июня 2019

@ Кашиш Хуллар , ваше решение отлично работает для большинства пакетов, но не работает, когда я пытаюсь установить drizzle .Теперь я нашел причину этого.Я установил Nodejs с бинарным в моем Ubuntu 18.04, который показывал вышеуказанную ошибку со многими пакетами NPM, такими как Web3.js .Поэтому я полностью удалил Nodejs и npm из своей системы и снова установил их с помощью менеджера пакетов apt-get, то есть sudo apt install nodejs npm.Теперь все работает без проблем.

0 голосов
/ 08 марта 2019

Надеюсь, это поможет

sudo npm install - сохранить web3 --unsafe-perm = true --allow-root

...