web3.js icon indicating copy to clipboard operation
web3.js copied to clipboard

Win10 npm install web3 doesn't work

Open arherzf8er opened this issue 8 years ago • 14 comments

Not new to web3 and have been actively using [email protected] since May, never experienced errors on numerous installs. Last time I npm install web3 on this machine over a week ago with no probs. Also to mention no programs were installed on this machine after last successful web3 installation.

Since last Sunday I'm getting quite the same result. Please find attached the log file. It should be also noted that npm install [email protected] works as usual.

npm install --save [email protected]
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN [email protected] No description
npm WARN [email protected] No repository field.

+ [email protected]
added 4 packages from 4 contributors, removed 295 packages and audited 6 packages in 34.952s
found 0 vulnerabilities

Please inform what additional information might help to resolve the issue.

What have been done since then:

  • [x] Uninstall nodejs while cleaning all trails
  • [x] Uninstall python 3.6
  • [x] Cleaning all the registry from relevant trails
  • [x] npm install -g --production windows-build-tools
  • [x] npm install -g node-gyp-install
  • [x] npm install -g node-gyp
  • [x] Install python 2.7 in root directory c:\python\
  • [x] Add all relevant pathes to PATH
  • [x] Install latest nodejs in root directory c:\nodejs\

Using [email protected] and [email protected]:

mkdir app
cd app
npm init
npm install web3 --save

npm WARN deprecated [email protected]: Use mz or fs-extra^3.0 with Promise Support npm WARN deprecated [email protected]: ⚠️ WARNING ⚠️ tar.gz module has been deprecated and your application is vulnerable. Please use tar module i nstead: https://npmjs.com/tar

[email protected] preinstall c:\app\node_modules\scrypt node node-scrypt-preinstall.js

[email protected] install c:\app\node_modules\scrypt node-gyp rebuild c:\app\node_modules\scrypt>if not defined npm_config_node_gyp (node "C:\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\....\node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (node "C:\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild ) internal/modules/cjs/loader.js:583 throw err; ^ Error: Cannot find module 'nan' at Function.Module._resolveFilename (internal/modules/cjs/loader.js:581:15) at Function.Module._load (internal/modules/cjs/loader.js:507:25) at Module.require (internal/modules/cjs/loader.js:637:17) at require (internal/modules/cjs/helpers.js:20:18) at [eval]:1:1 at Script.runInThisContext (vm.js:91:20) at Object.runInThisContext (vm.js:298:38) at Object. ([eval]-wrapper:6:22) at Module._compile (internal/modules/cjs/loader.js:689:30) at evalScript (internal/bootstrap/node.js:527:27) gyp: Call to 'node -e "require('nan')"' returned exit status 1 while in binding.gyp. while trying to load binding.gyp gyp ERR! configure error gyp ERR! stack Error: gyp failed with exit code: 1 gyp ERR! stack at ChildProcess.onCpExit (C:\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:336:16) gyp ERR! stack at ChildProcess.emit (events.js:182:13) gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:237:12) gyp ERR! System Windows_NT 10.0.14393 gyp ERR! command "C:\nodejs\node.exe" "C:\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" "rebuild" gyp ERR! cwd c:\app\node_modules\scrypt gyp ERR! node -v v10.6.0 gyp ERR! node-gyp -v v3.6.2 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.

Also tried yarn add with no luck.

Please find attached the log file

2018-07-17T09_45_55_624Z-debug.log

arherzf8er avatar Jul 17 '18 10:07 arherzf8er

Thanks for that well documented issue! I'll test it on my windows computer tonight.

nivida avatar Jul 17 '18 11:07 nivida

You could try to run this first as workaround:

npm install nan --save

Simon0x avatar Jul 17 '18 12:07 Simon0x

Thank you for the suggestion, I've already tried and unfortunately it didn't work out this time either.

c:\app>npm install nan --save npm WARN [email protected] No description npm WARN [email protected] No repository field.

[email protected] removed 296 packages and updated 1 package in 2.224s

c:\app>npm install --save web3 npm WARN deprecated [email protected]: Use mz or fs-extra^3.0 with Promise Support npm WARN deprecated [email protected]: ⚠️ WARNING ⚠️ tar.gz module has been deprecated and your application is vulnerable. Please use tar module instead: https://npmjs.com/tar

[email protected] preinstall c:\app\node_modules\scrypt node node-scrypt-preinstall.js

[email protected] install c:\app\node_modules\scrypt node-gyp rebuild

c:\app\node_modules\scrypt>if not defined npm_config_node_gyp (node "C:\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\....\node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (node "C:\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild ) module.js:549 throw err; ^

Error: Cannot find module 'nan' at Function.Module._resolveFilename (module.js:547:15) at Function.Module._load (module.js:474:25) at Module.require (module.js:596:17) at require (internal/module.js:11:18) at [eval]:1:1 at ContextifyScript.Script.runInThisContext (vm.js:50:33) at Object.runInThisContext (vm.js:139:38) at Object. ([eval]-wrapper:6:22) at Module._compile (module.js:652:30) at evalScript (bootstrap_node.js:466:27) gyp: Call to 'node -e "require('nan')"' returned exit status 1 while in binding.gyp. while trying to load binding.gyp gyp ERR! configure error gyp ERR! stack Error: gyp failed with exit code: 1 gyp ERR! stack at ChildProcess.onCpExit (C:\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:336:16) 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 Windows_NT 10.0.14393 gyp ERR! command "C:\nodejs\node.exe" "C:\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" "rebuild" gyp ERR! cwd c:\app\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 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.

arherzf8er avatar Jul 17 '18 15:07 arherzf8er

So I've tested it on my windows notebook and I can install web3 if everything is configured correctly.

  1. npm install --global --production windows-build-tools
  2. npm install --global node-gyp
  3. setx PYTHON "%USERPROFILE%\.windows-build-tools\python27\python.exe"
  4. npm config set python python2.7 --global
  5. npm config set python C:\Python27\python.exe --global
  6. npm config set msvs_version 2015 --global
  7. set VCTargetsPath=C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140

After that it worked for me. It's been a long time since i worked with windows maybe not all steps are required idk.

nivida avatar Jul 17 '18 16:07 nivida

@nividia this didnot work, the scrypt remains a problem

migueldeguzman avatar Aug 18 '18 01:08 migueldeguzman

tried all these options. but cannot get web3 installed on win10.

sreepriyaks avatar Aug 26 '18 08:08 sreepriyaks

The problem with web3@^0.20.0 and probably with other versions earlier than web3@^1.0.0-beta.36 is that modules like web3.utils necessary for getting balances, building transactions etc. don't seem to work or perhaps even exist, so installing the 0.20.0 version doesn't really solve the problem. I am nowhere near 100% sure, but it seems that running npm install --global --production windows-build-tools from Windows PowerShell (as an ADMIN!) and then installing web3@^1.0.0-beta.36 is the only way.

igoreskin avatar Nov 04 '18 04:11 igoreskin

@nivida i have followed all the steps as mentioned above . but facing problems regarding the last one i.e:set VCTargetsPath=C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140 when i open my MSBuild folder i do not have v.4.0 but v3.0 and v3.5 . what should i do???? please help

jaikrish5 avatar Jan 31 '19 17:01 jaikrish5

I think these steps (https://github.com/ethereum/web3.js/issues/1783#issuecomment-405650471) should be included in the Readme.

Or check if with https://github.com/ethereum/web3.js/pull/2642 these errors cease to raise.

paulmelero avatar Apr 03 '19 14:04 paulmelero

I ahve tried about every option I can come across in regards to downloading a particular version [email protected] for a bootcamp Im doing at the moment can anyone help me out please, it would be greatly appreciated. tbelow is the script I consistently get back. Cheers.

gyp ERR! stack Error: C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe failed with exit code: 1 gyp ERR! stack at ChildProcess.onExit (C:\Users\HOME\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\build.js:262:23) gyp ERR! stack at ChildProcess.emit (events.js:180:13) gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:209:12) gyp ERR! System Windows_NT 10.0.17763 gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Users\HOME\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" "rebuild" gyp ERR! cwd C:\Windows\system32\test\node_modules\scrypt gyp ERR! node -v v9.10.0 gyp ERR! node-gyp -v v3.8.0 gyp ERR! not ok npm WARN enoent ENOENT: no such file or directory, open 'C:\Windows\system32\test\package.json' npm WARN test No description npm WARN test No repository field. npm WARN test No README data npm WARN test No license 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! C:\Users\HOME\AppData\Roaming\npm-cache_logs\2019-06-05T02_50_11_237Z-debug.log PS C:\Windows\system32\test> npm install --save scrypt6.0.3 npm ERR! code E404 npm ERR! 404 Not Found - GET https://registry.npmjs.org/scrypt6.0.3 - Not found npm ERR! 404 npm ERR! 404 'scrypt6.0.3@latest' is not in the npm registry. npm ERR! 404 You should bug the author to publish it (or use the name yourself!) npm ERR! 404 npm ERR! 404 Note that you can also install from a npm ERR! 404 tarball, folder, http url, or git url.

npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\HOME\AppData\Roaming\npm-cache_logs\2019-06-05T02_52_50_289Z-debug.log PS C:\Windows\system32\test>

siaosiw avatar Jun 05 '19 03:06 siaosiw

I ahve tried about every option I can come across in regards to downloading a particular version [email protected] for a bootcamp Im doing at the moment can anyone help me out please, it would be greatly appreciated. tbelow is the script I consistently get back. Cheers. gyp ERR! stack Error: C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe failed with exit code: 1 gyp ERR! stack at ChildProcess.onExit (C:\Users\HOME\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\build.js:262:23) gyp ERR! stack at ChildProcess.emit (events.js:180:13) gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:209:12) gyp ERR! System Windows_NT 10.0.17763 gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Users\HOME\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" "rebuild" gyp ERR! cwd C:\Windows\system32\test\node_modules\scrypt gyp ERR! node -v v9.10.0 gyp ERR! node-gyp -v v3.8.0 gyp ERR! not ok npm WARN enoent ENOENT: no such file or directory, open 'C:\Windows\system32\test\package.json' npm WARN test No description npm WARN test No repository field. npm WARN test No README data npm WARN test No license 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! C:\Users\HOME\AppData\Roaming\npm-cache_logs\2019-06-05T02_50_11_237Z-debug.log PS C:\Windows\system32\test> npm install --save scrypt6.0.3 npm ERR! code E404 npm ERR! 404 Not Found - GET https://registry.npmjs.org/scrypt6.0.3 - Not found npm ERR! 404 npm ERR! 404 'scrypt6.0.3@latest' is not in the npm registry. npm ERR! 404 You should bug the author to publish it (or use the name yourself!) npm ERR! 404 npm ERR! 404 Note that you can also install from a npm ERR! 404 tarball, folder, http url, or git url. npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\HOME\AppData\Roaming\npm-cache_logs\2019-06-05T02_52_50_289Z-debug.log PS C:\Windows\system32\test>

I am having the same problem with the same error message while trying to install [email protected]. Has anyone solved this issue?

Islandersfan2016 avatar Aug 25 '19 19:08 Islandersfan2016

Sorry I didn't get that problem solved. I ended up asking for refund with much regret. Apparently it is much easier if you use a Linux OS. Let me know if you find a fix please.

Very best

On Mon, Aug 26, 2019, 8:36 AM LamontX [email protected] wrote:

I ahve tried about every option I can come across in regards to downloading a particular version [email protected] for a bootcamp Im doing at the moment can anyone help me out please, it would be greatly appreciated. tbelow is the script I consistently get back. Cheers. gyp ERR! stack Error: C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe failed with exit code: 1 gyp ERR! stack at ChildProcess.onExit (C:\Users\HOME\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\build.js:262:23) gyp ERR! stack at ChildProcess.emit (events.js:180:13) gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:209:12) gyp ERR! System Windows_NT 10.0.17763 gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Users\HOME\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" "rebuild" gyp ERR! cwd C:\Windows\system32\test\node_modules\scrypt gyp ERR! node -v v9.10.0 gyp ERR! node-gyp -v v3.8.0 gyp ERR! not ok npm WARN enoent ENOENT: no such file or directory, open 'C:\Windows\system32\test\package.json' npm WARN test No description npm WARN test No repository field. npm WARN test No README data npm WARN test No license 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! C:\Users\HOME\AppData\Roaming\npm-cache_logs\2019-06-05T02_50_11_237Z-debug.log PS C:\Windows\system32\test> npm install --save scrypt6.0.3 npm ERR! code E404 npm ERR! 404 Not Found - GET https://registry.npmjs.org/scrypt6.0.3 - Not found npm ERR! 404 npm ERR! 404 'scrypt6.0.3@latest' is not in the npm registry. npm ERR! 404 You should bug the author to publish it (or use the name yourself!) npm ERR! 404 npm ERR! 404 Note that you can also install from a npm ERR! 404 tarball, folder, http url, or git url. npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\HOME\AppData\Roaming\npm-cache_logs\2019-06-05T02_52_50_289Z-debug.log PS C:\Windows\system32\test>

I am having the same problem with the same error message while trying to install [email protected]. Has anyone solved this issue?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/ethereum/web3.js/issues/1783?email_source=notifications&email_token=AMIBGIAFZZ3BLL2TVFY7QPLQGLNKVA5CNFSM4FKKONIKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD5C2GWA#issuecomment-524657496, or mute the thread https://github.com/notifications/unsubscribe-auth/AMIBGIFUX5MXBJIW7WHGFUTQGLNKVANCNFSM4FKKONIA .

siaosiw avatar Aug 28 '19 19:08 siaosiw

need help!!!..i am having this issues when i try to install node-gyp 3.6.2

PS C:\Users\User> npm install --global [email protected] npm WARN deprecated [email protected]: request has been deprecated, see #3142 npm ERR! path C:\Users\User\AppData\Roaming\npm\node-gyp.cmd npm ERR! code EEXIST npm ERR! Refusing to delete C:\Users\User\AppData\Roaming\npm\node-gyp.cmd: is outside C:\Users\User\AppData\Roaming\npm\node_modules\node-gyp and not a link npm ERR! File exists: C:\Users\User\AppData\Roaming\npm\node-gyp.cmd npm ERR! Move it away, and try again.

npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\User\AppData\Roaming\npm-cache_logs\2020-02-13T05_12_13_683Z-debug.log

Meharab avatar Feb 13 '20 06:02 Meharab

Try using yarn I use yarn global add [email protected] it works for me

mochi1351 avatar Aug 27 '21 21:08 mochi1351