I am trying to install web3 globally and locally
npm install -g web3
npm install --save web3
both of them are giving me errors. I have previously successfully installed web3 both globally and in local project
@Lenovo-ideapad-700-15ISK:~$ sudo npm install -g web3
[sudo] password for :
> [email protected] postinstall /usr/lib/node_modules/web3
> lerna bootstrap
lerna info version 2.0.0
lerna info Bootstrapping 19 packages
lerna info lifecycle preinstall
lerna info Installing external dependencies
lerna ERR! execute Error: Command failed: npm install
lerna ERR! execute npm ERR! addLocal Could not install /usr/lib/node_modules/web3/packages/web3-eth-abi
lerna ERR! execute npm ERR! Linux 4.8.0-58-generic
lerna ERR! execute npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install"
lerna ERR! execute npm ERR! node v6.11.0
lerna ERR! execute npm ERR! npm v3.10.10
lerna ERR! execute
lerna ERR! execute npm ERR! No name provided in package.json
lerna ERR! execute npm ERR!
lerna ERR! execute npm ERR! If you need help, you may report this error at:
lerna ERR! execute npm ERR! <https://github.com/npm/npm/issues>
lerna ERR! execute
lerna ERR! execute npm ERR! Please include the following file with any support request:
lerna ERR! execute npm ERR! /usr/lib/node_modules/web3/packages/web3-eth-abi/npm-debug.log
lerna ERR! execute
lerna ERR! execute at Promise.all.then.arr (/usr/lib/node_modules/web3/node_modules/execa/index.js:210:11)
lerna ERR! execute at process._tickCallback (internal/process/next_tick.js:109:7)
lerna ERR! execute callback with error
lerna ERR! execute { Error: Command failed: npm install
lerna ERR! execute npm ERR! addLocal Could not install /usr/lib/node_modules/web3/packages/web3-eth-abi
lerna ERR! execute npm ERR! Linux 4.8.0-58-generic
lerna ERR! execute npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install"
lerna ERR! execute npm ERR! node v6.11.0
lerna ERR! execute npm ERR! npm v3.10.10
lerna ERR! execute
lerna ERR! execute npm ERR! No name provided in package.json
lerna ERR! execute npm ERR!
lerna ERR! execute npm ERR! If you need help, you may report this error at:
lerna ERR! execute npm ERR! <https://github.com/npm/npm/issues>
lerna ERR! execute
lerna ERR! execute npm ERR! Please include the following file with any support request:
lerna ERR! execute npm ERR! /usr/lib/node_modules/web3/packages/web3-eth-abi/npm-debug.log
lerna ERR! execute
lerna ERR! execute at Promise.all.then.arr (/usr/lib/node_modules/web3/node_modules/execa/index.js:210:11)
lerna ERR! execute at process._tickCallback (internal/process/next_tick.js:109:7)
lerna ERR! execute stack: 'Error: Command failed: npm install\nnpm ERR! addLocal Could not install /usr/lib/node_modules/web3/packages/web3-eth-abi\nnpm ERR! Linux 4.8.0-58-generic\nnpm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install"\nnpm ERR! node v6.11.0\nnpm ERR! npm v3.10.10\n\nnpm ERR! No name provided in package.json\nnpm ERR! \nnpm ERR! If you need help, you may report this error at:\nnpm ERR! <https://github.com/npm/npm/issues>\n\nnpm ERR! Please include the following file with any support request:\nnpm ERR! /usr/lib/node_modules/web3/packages/web3-eth-abi/npm-debug.log\n\n at Promise.all.then.arr (/usr/lib/node_modules/web3/node_modules/execa/index.js:210:11)\n at process._tickCallback (internal/process/next_tick.js:109:7)',
lerna ERR! execute code: 1,
lerna ERR! execute killed: false,
lerna ERR! execute stdout: '',
lerna ERR! execute stderr: 'npm ERR! addLocal Could not install /usr/lib/node_modules/web3/packages/web3-eth-abi\nnpm ERR! Linux 4.8.0-58-generic\nnpm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install"\nnpm ERR! node v6.11.0\nnpm ERR! npm v3.10.10\n\nnpm ERR! No name provided in package.json\nnpm ERR! \nnpm ERR! If you need help, you may report this error at:\nnpm ERR! <https://github.com/npm/npm/issues>\n\nnpm ERR! Please include the following file with any support request:\nnpm ERR! /usr/lib/node_modules/web3/packages/web3-eth-abi/npm-debug.log\n',
lerna ERR! execute failed: true,
lerna ERR! execute signal: null,
lerna ERR! execute cmd: 'npm install',
lerna ERR! execute timedOut: false }
lerna WARN complete Waiting for 3 child processes to exit. CTRL-C to exit immediately.
(node:6065) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 3): Error: Command failed: npm install
npm ERR! addLocal Could not install /usr/lib/node_modules/web3/packages/web3-eth-abi
npm ERR! Linux 4.8.0-58-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install"
npm ERR! node v6.11.0
npm ERR! npm v3.10.10
npm ERR! No name provided in package.json
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR! <https://github.com/npm/npm/issues>
npm ERR! Please include the following file with any support request:
npm ERR! /usr/lib/node_modules/web3/packages/web3-eth-abi/npm-debug.log
(node:6065) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 6): Error: Command failed: npm install
npm ERR! addLocal Could not install /usr/lib/node_modules/web3/packages/web3-utils
npm ERR! Linux 4.8.0-58-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install"
npm ERR! node v6.11.0
npm ERR! npm v3.10.10
npm ERR! No name provided in package.json
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR! <https://github.com/npm/npm/issues>
npm ERR! Please include the following file with any support request:
npm ERR! /usr/lib/node_modules/web3/packages/web3-utils/npm-debug.log
(node:6065) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 9): Error: Command failed: npm install
npm ERR! addLocal Could not install /usr/lib/node_modules/web3/packages/web3-eth-iban
npm ERR! Linux 4.8.0-58-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install"
npm ERR! node v6.11.0
npm ERR! npm v3.10.10
npm ERR! No name provided in package.json
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR! <https://github.com/npm/npm/issues>
npm ERR! Please include the following file with any support request:
npm ERR! /usr/lib/node_modules/web3/packages/web3-eth-iban/npm-debug.log
npm ERR! Linux 4.8.0-58-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install" "-g" "web3"
npm ERR! node v6.11.0
npm ERR! npm v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! [email protected] postinstall: `lerna bootstrap`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] postinstall script 'lerna bootstrap'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the web3 package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! lerna bootstrap
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs web3
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls web3
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
Same problem
I think postinstall.js tries to look for node.exe inside the web3 folder
A part of my log:
8411 info lifecycle [email protected]~postinstall: [email protected]
8412 verbose lifecycle [email protected]~postinstall: unsafe-perm in lifecycle true
8413 verbose lifecycle [email protected]~postinstall: PATH: F:\01 SOFTWARES\NodeJS 8.1.2\node-v8.1.2-win-x64\node_modules\npm\bin\node-gyp-bin;F:\01 SOFTWARES\NodeJS 8.1.2\node-v8.1.2-win-x64\node_modules\web3\node_modules\.bin;F:\01 SOFTWARES\NodeJS 8.1.2\node-v8.1.2-win-x64\node_modules\.bin;C:\ProgramData\Oracle\Java\javapath;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;F:\01 SOFTWARES\Git\Git\cmd;F:\01 SOFTWARES\Anaconda;F:\01 SOFTWARES\Anaconda\Scripts;F:\01 SOFTWARES\Anaconda\Library\bin;C:\Program Files (x86)\PharosSystems\Core;C:\Program Files (x86)\GtkSharp\2.12\bin;F:\01 SOFTWARES\3DS Max 2009\Backburner\;C:\Program Files\Common Files\Autodesk Shared\;F:\01 SOFTWARES\Ethereum\Geth;C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit\;C:\Users\Amit\AppData\Local\Microsoft\WindowsApps;C:\Users\Amit\AppData\Local\atom\bin;C:\Users\Amit\AppData\Local\Microsoft\WindowsApps
8414 verbose lifecycle [email protected]~postinstall: CWD: F:\01 SOFTWARES\NodeJS 8.1.2\node-v8.1.2-win-x64\node_modules\web3
8415 silly lifecycle [email protected]~postinstall: Args: [ '/d /s /c', 'lerna bootstrap' ]
8416 silly lifecycle [email protected]~postinstall: Returned: code: 1 signal: null
8417 info lifecycle [email protected]~postinstall: Failed to exec postinstall script
8418 verbose unlock done using C:\Users\Amit\AppData\Roaming\npm-cache\_locks\staging-d767f7daaa27bf88.lock for F:\01 SOFTWARES\NodeJS 8.1.2\node-v8.1.2-win-x64\node_modules\.staging
8419 verbose stack Error: [email protected] postinstall:lerna bootstrap
8419 verbose stack Exit status 1
8419 verbose stack at EventEmitter.<anonymous> (F:\01 SOFTWARES\NodeJS 8.1.2\node-v8.1.2-win-x64\node_modules\npm\lib\utils\lifecycle.js:283:16)
8419 verbose stack at emitTwo (events.js:125:13)
8419 verbose stack at EventEmitter.emit (events.js:213:7)
Also I already have lerna and bootstrap installed...maybe check for them before installing?
Running Windows10 64
Does it help if you clear the npm cache, and remove the node_modules folder and re run npm install?
Do you mean the npm folder in my node installation or the one in APPDATA?
I have tried running it on node 8.1.2 and node 6.2.
Node 6.2 gave the following error log. The one in earlier post was 8.1.2.
21520 info lifecycle [email protected]~postinstall: Failed to exec postinstall script
21521 verbose unlock done using C:\Users\Amit\AppData\Roaming\npm-cache\_locks\staging-d5dd9d1d8a8a3d21.lock for F:\01 SOFTWARES\NodeJS 6.2.0\node_modules\.staging
21522 silly rollbackFailedOptional Starting
21523 silly rollbackFailedOptional Finishing
21524 silly runTopLevelLifecycles Starting
21525 silly runTopLevelLifecycles Finishing
21526 silly install printInstalled
21527 warn optional Skipping failed optional dependency /chokidar/fsevents:
21528 warn notsup Not compatible with your operating system or architecture: [email protected]
21529 warn enoent ENOENT: no such file or directory, open 'F:\01 SOFTWARES\NodeJS 6.2.0\package.json'
21530 warn NodeJS 6.2.0 No description
21531 warn NodeJS 6.2.0 No repository field.
21532 warn NodeJS 6.2.0 No README data
21533 warn NodeJS 6.2.0 No license field.
21534 verbose stack Error: [email protected] postinstall:lerna bootstrap
21534 verbose stack Exit status 1
21534 verbose stack at EventEmitter.<anonymous> (F:\01 SOFTWARES\NodeJS 6.2.0\node_modules\npm\lib\utils\lifecycle.js:245:16)
21534 verbose stack at emitTwo (events.js:106:13)
21534 verbose stack at EventEmitter.emit (events.js:191:7)
21534 verbose stack at ChildProcess.<anonymous> (F:\01 SOFTWARES\NodeJS 6.2.0\node_modules\npm\lib\utils\spawn.js:24:14)
21534 verbose stack at emitTwo (events.js:106:13)
21534 verbose stack at ChildProcess.emit (events.js:191:7)
21534 verbose stack at maybeClose (internal/child_process.js:850:16)
21534 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:215:5)
21535 verbose pkgid [email protected]
21536 verbose cwd F:\01 SOFTWARES\NodeJS 6.2.0
21537 error Windows_NT 10.0.15063
21538 error argv "F:\\01 SOFTWARES\\NodeJS 6.2.0\\node.exe" "F:\\01 SOFTWARES\\NodeJS 6.2.0\\node_modules\\npm\\bin\\npm-cli.js" "install" "web3"
21539 error node v6.2.0
21540 error npm v3.8.9
21541 error code ELIFECYCLE
21542 error [email protected] postinstall:lerna bootstrap
21542 error Exit status 1
21543 error Failed at the [email protected] postinstall script 'lerna bootstrap'.
21543 error Make sure you have the latest version of node.js and npm installed.
21543 error If you do, this is most likely a problem with the web3 package,
21543 error not with npm itself.
21543 error Tell the author that this fails on your system:
21543 error lerna bootstrap
21543 error You can get information on how to open an issue for this project with:
21543 error npm bugs web3
21543 error Or if that isn't available, you can get their info via:
21543 error npm owner ls web3
21543 error There is likely additional logging output above.
21544 verbose exit [ 1, true ]
i uninstall lerna and web3 by running npm uninstall -g lerna and pm uninstall -g web3 and i still get the same errors
Try running npm cache verify if you are using npm v5+ or npm cache clean for older versions.
I have the same problem when I tried to install web3 beta12 globally.
Tried "npm cache verify" without success.
I'm using Using node 8.2.1 and npm 5.3.0 on OSX.
But ...
I'm able to install it locally !
Closing in favour of #950
If you are on Windows try this code first and try to install:
npm install --global --production windows-build-tools (Administrator privilege)
Or you can try this code:
npm install -g ethereum/web3.js
Please let know if any method works.
@071bctajay Is there a reason why you're installing globally?
Mac OS
commend: npm install web3
problem:
1 warning and 1 error generated.
make: * [Release/obj.target/scrypt_wrapper/src/scryptwrapper/keyderivation.o] Error 1
gyp ERR! build error
gyp ERR! stack Error: make failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:258:23)
gyp ERR! stack at emitTwo (events.js:126:13)
gyp ERR! stack at ChildProcess.emit (events.js:214:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
gyp ERR! System Darwin 17.7.0
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 /Users/tianlele/Documents/vevid_sc/VEVID01/node_modules/scrypt
gyp ERR! node -v v8.11.3
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
npm WARN [email protected] No repository field.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: node-gyp rebuild
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] 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:
@gitHub-Tienlele I had the same issue till yesterday,
please refer to this link
https://github.com/Microsoft/nodejs-guidelines/blob/master/windows-environment.md#compiling-native-addon-modules
I followed instructions to manually setup the environment.
install vs 2017 community version with "c++ for desktop development" workload as mentioned and do the next steps. this much should be enough to get you running.
Thanks, good luck 👍
Anyone having this problem just "Run as admin in your Powershell or Node.js CMD
1) npm install --global --production windows-build-tools
after the installation is complete
2) npm install [email protected] (or any beta version you like up to 36 if i'm not mistaken)
I had "MSB4019 error " issue , I found many ways but no work!
Finally I found solution at https://github.com/Microsoft/nodejs-guidelines/blob/master/windows-environment.md#compiling-native-addon-modules
Thanks @indrajitbnikam I found my result in that link.
VCTargetsPath top point at the C++ build tools path. This should be something like C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\v140\ (where 140 corresponds to Visual Studio 2015)Attention: the lastest character '\' of VCTargetsPath is important for visual studio 2015, if '\' is missing will cause visual studio 2015 cannot create c++ project!!! becareful!!
====================================
我今天安装Web3折腾了半天, 我系统上已经有vs2015, 但是用npm安装web3时总是报 "MSB4019 error", 最终找到了解决方法:
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\v140\ (前提是你安装了vs, 如果vs版本不同, 请自行调整), 然后将在系统path中添加这个变量 , %VCTargetsPath%. 重新打开cmd, 使用npm install web3 -g 安装web3即可.注意: VCTargetsPath 最后一个 '\'不能少, 否则会导致vs2015不能新建C++工程!!! 这是我遇到坑!! 2018-12-23留
I can't also install [email protected], and try to solve the problem by the following method
[root@nodes deploy]# npm install -g node-gyp
[root@nodes deploy]# npm init -y
[root@nodes deploy]# npm install --save [email protected]
> [email protected] preinstall /root/backup/issue_token/ausd/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
> [email protected] install /root/backup/issue_token/ausd/node_modules/scrypt
> node-gyp rebuild
gyp WARN EACCES user "root" does not have permission to access the dev dir "/root/.node-gyp/10.15.1"
gyp WARN EACCES attempting to reinstall using temporary dev dir "/root/backup/issue_token/ausd/node_modules/scrypt/.node-gyp"
gyp WARN install got an error, rolling back install
gyp WARN install got an error, rolling back install
gyp ERR! configure error
gyp ERR! stack Error: EACCES: permission denied, mkdir '/root/backup/issue_token/ausd/node_modules/scrypt/.node-gyp'
gyp ERR! System Linux 3.10.0-862.el7.x86_64
gyp ERR! command "/usr/local/node/bin/node" "/usr/local/node/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /root/backup/issue_token/ausd/node_modules/scrypt
gyp ERR! node -v v10.15.1
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
npm WARN [email protected] No description
npm WARN [email protected] No repository field.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] 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-21T04_43_47_170Z-debug.log
and after change my account from root to deploy, then it's success!
Most helpful comment
If you are on Windows try this code first and try to install:
npm install --global --production windows-build-tools (Administrator privilege)
Or you can try this code:
npm install -g ethereum/web3.js
Please let know if any method works.