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

can not install web3

Open Aliasgharmohammad opened this issue 9 years ago • 34 comments

hi i have tried to install web3 but every time i fail, this is what I receive as an error

here is the problem occurs at first it installs and proceds but nearly at the end it fails

c:\mylocal>npm install web3 --save npm WARN deprecated [email protected]: Use mz or fs-extra^3.0 with Promise Support npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue

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

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

c:\mylocal\node_modules\scrypt>if not defined npm_config_node_gyp (node "C:\Users\Ali\AppData\Roaming\npm\node_modules\npm\bin\node-gyp-bin\....\node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (node "" rebuild ) gyp ERR! configure error gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable. gyp ERR! stack at Object.failNoPython (C:\Users\Ali\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\configure.js:483:19) gyp ERR! stack at Object. (C:\Users\Ali\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\configure.js:508:16) gyp ERR! stack at C:\Users\Ali\AppData\Roaming\npm\node_modules\npm\node_modules\graceful-fs\polyfills.js:284:29 gyp ERR! stack at FSReqWrap.oncomplete (fs.js:123:15) gyp ERR! System Windows_NT 10.0.14393 gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Users\Ali\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" "rebuild" gyp ERR! cwd c:\mylocal\node_modules\scrypt gyp ERR! node -v v6.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.

npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\Ali\AppData\Roaming\npm-cache_logs\2017-09-22T10_26_48_623Z-debug.log

c:\mylocal>

Aliasgharmohammad avatar Sep 22 '17 11:09 Aliasgharmohammad

Im having the same issue. I faced in other implementation with the same issue and I solved installing visual studio or a couple of third-party lib. but in this case, it doesnt works, I tried npm install --global --production windows-build-tools

jupadev avatar Oct 24 '17 00:10 jupadev

I've solved this using the following steps

  • npm install --global --production windows-build-tools
  • node-gyp configure --msvs_version=2015
  • npm config set python /path/to/executable/python2.7
  • npm install web3 --save

jupadev avatar Oct 24 '17 01:10 jupadev

take a look this guideline https://github.com/nodejs/node-gyp

jupadev avatar Oct 24 '17 01:10 jupadev

I want a specific version web3 @1.0.0-beta.26 Run as the administrator npm install --global --production windows-build-tools

npm -g install npm@next npm install --save [email protected]

dacho68 avatar Jan 21 '18 20:01 dacho68

thanks a lot jupadev

Aliasgharmohammad avatar Jan 29 '18 19:01 Aliasgharmohammad

thanks a alot dacho68 too

Aliasgharmohammad avatar Jan 30 '18 14:01 Aliasgharmohammad

My problem was resolved just to run below command, especially I'm using pyenv for multiple python versions, so $HOME/.pyenv/versions/2.7.x/bin/python worked for me.

npm config set python /path/to/executable/python2.7

tanayuk avatar Feb 15 '18 15:02 tanayuk

On Centos I resolved by:

sudo yum install centos-release-scl sudo yum install devtoolset-7-gcc* scl enable devtoolset-7 bash which gcc gcc --version

coolmagic avatar Mar 10 '18 06:03 coolmagic

Hello , After install all windows build tools and node-gyp package , I am still getting the error .

Can any one please help me in resolving this issue.

log :

C:\Users\Simplyfi\Desktop\aditya\work_space\web\node\new_stf\n\stf_web3js>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 instea d: https://npmjs.com/tar

[email protected] preinstall C:\Users\Simplyfi\Desktop\aditya\work_space\web\node\new_stf\n\stf_web3js\node_modules\scrypt node node-scrypt-preinstall.js

[email protected] install C:\Users\Simplyfi\Desktop\aditya\work_space\web\node\new_stf\n\stf_web3js\node_modules\scrypt node-gyp rebuild

C:\Users\Simplyfi\Desktop\aditya\work_space\web\node\new_stf\n\stf_web3js\node_modules\scrypt>if not defined npm_config_node_gyp (node "C:\Users\Simplyfi\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\....\node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (node "C:\Users\Simplyfi\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\node_modules\node-gyp\bin\node-gyp.js" rebuild ) Warning: Missing input files: C:\Users\Simplyfi\Desktop\aditya\work_space\web\node\new_stf\n\stf_web3js\node_modules\scrypt\build..\scrypt\win\include\config.h Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch. Copying scrypt/win/include/config.h to scrypt/scrypt-1.2.0/config.h The system cannot find the file specified. C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppCommon.targets(356,5): error MSB6006: "CL.exe" exited with code -1073741515. [ C:\Users\Simplyfi\Desktop\aditya\work_space\web\node\new_stf\n\stf_web3js\node_modules\scrypt\build\copied_files.vcxproj] C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppCommon.targets(356,5): error MSB6006: "CL.exe" exited with code -1073741515. [ C:\Users\Simplyfi\Desktop\aditya\work_space\web\node\new_stf\n\stf_web3js\node_modules\scrypt\build\scrypt_wrapper.vcxproj] gyp ERR! build error 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\Simplyfi\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\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 Windows_NT 10.0.16299 gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Users\Simplyfi\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\node_modules\node-gyp\bin\node-gyp.js" "rebuild" gyp ERR! cwd C:\Users\Simplyfi\Desktop\aditya\work_space\web\node\new_stf\n\stf_web3js\node_modules\scrypt gyp ERR! node -v v8.10.0 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: npm ERR! C:\Users\Simplyfi\AppData\Roaming\npm-cache_logs\2018-03-28T05_29_51_133Z-debug.log

ADitya024 avatar Mar 28 '18 05:03 ADitya024

@ADitya024 same issue..anyone please help..

DTiapan avatar May 15 '18 18:05 DTiapan

+1 @ADitya024 Same Issue

zeshanvirk avatar May 18 '18 09:05 zeshanvirk

Thanks for the solution:)

epochchaser avatar Jun 09 '18 07:06 epochchaser

Hello, any solution for mac users?

chema2708 avatar Jul 06 '18 07:07 chema2708

@chema2708 Hello , Have you solved this problem?

logan059 avatar Jul 13 '18 01:07 logan059

npm install web3 --save Error

anybody please help. Thanks

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 npm WARN deprecated [email protected]: Use mz or fs-extra^3.0 with Promise Support

[email protected] preinstall /Users/tianlele/Documents/vevid_sc/vevid03/node_modules/scrypt node node-scrypt-preinstall.js

[email protected] install /Users/tianlele/Documents/vevid_sc/vevid03/node_modules/scrypt node-gyp rebuild

gyp ERR! configure error gyp ERR! stack Error: Can't find Python executable "/path/to/executable/python2.7", you can set the PYTHON env variable. gyp ERR! stack at PythonFinder.failNoPython (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:483:19) gyp ERR! stack at PythonFinder. (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:397:16) gyp ERR! stack at F (/usr/local/lib/node_modules/npm/node_modules/which/which.js:68:16) gyp ERR! stack at E (/usr/local/lib/node_modules/npm/node_modules/which/which.js:80:29) gyp ERR! stack at /usr/local/lib/node_modules/npm/node_modules/which/which.js:89:16 gyp ERR! stack at /usr/local/lib/node_modules/npm/node_modules/which/node_modules/isexe/index.js:42:5 gyp ERR! stack at /usr/local/lib/node_modules/npm/node_modules/which/node_modules/isexe/mode.js:8:5 gyp ERR! stack at FSReqWrap.oncomplete (fs.js:152:21) 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/vevid03/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] requires a peer of ajv@^6.0.0 but none is installed. You must install peer dependencies yourself.

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:

logan059 avatar Jul 13 '18 02:07 logan059

@gitHub-Tienlele Looks like your Python path is not in defined. This means either you don´t have python installed or you have a custom path. To see if you have it installed just run "which python" in the console, if it´s installed will throw the path to python executable and then you need to define it in your $HOME or env variables. If it´s not installed just look for a tutorial on how to install it and make sure you download version 2.7 (sometimes it installs all versions and you just need to jump between them) Then run "npm install --python=python2.7" and then run "npm install [email protected] --save"

chema2708 avatar Jul 13 '18 05:07 chema2708

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 👍

indrajitbnikam avatar Jul 17 '18 17:07 indrajitbnikam

Please look at this issue: https://github.com/ethereum/web3.js/issues/1783

nivida avatar Aug 09 '18 12:08 nivida

After installing the windows-build-tools and setting the python path I am still facing the below issue.

Admin@Admin-PC MINGW64 ~/inbox $ npm install --save-dev [email protected]

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:\Users\Admin\inbox\node_modules\scrypt node node-scrypt-preinstall.js

[email protected] install C:\Users\Admin\inbox\node_modules\scrypt node-gyp rebuild

C:\Users\Admin\inbox\node_modules\scrypt>if not defined npm_config_node_gyp (node "C:\Users\Admin\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\....\node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (node "C:\Users\Admin\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild ) Warning: Missing input files: C:\Users\Admin\inbox\node_modules\scrypt\build..\scrypt\win\include\config.h Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch. Copying scrypt/win/include/config.h to scrypt/scrypt-1.2.0/config.h The system cannot find the file specified. C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppCommon.targets(356,5): error MSB6006: "CL.exe" exited with code -1073741515. [C:\Users\Admin\inbox\node_modules\scrypt\build\copied_files.vcxproj] C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppCommon.targets(356,5): error MSB6006: "CL.exe" exited with code -1073741515. [C:\Users\Admin\inbox\node_modules\scrypt\build\scrypt_wrapper.vcxproj] gyp ERR! build error 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\Admin\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\build.js:262: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 Windows_NT 6.1.7600 gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Users\Admin\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" "rebuild" gyp ERR! cwd C:\Users\Admin\inbox\node_modules\scrypt gyp ERR! node -v v8.11.3 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 WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

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\Admin\AppData\Roaming\npm-cache_logs\2018-08-09T14_54_53_358Z-debug.log

saikat909 avatar Aug 09 '18 14:08 saikat909

Node 10.9.0 NPM 6.4.0

239 verbose stack Error: [email protected] install: node-gyp rebuild 239 verbose stack Exit status 1 239 verbose stack at EventEmitter. (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:304:16) 239 verbose stack at EventEmitter.emit (events.js:180:13) 239 verbose stack at ChildProcess. (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14) 239 verbose stack at ChildProcess.emit (events.js:180:13) 239 verbose stack at maybeClose (internal/child_process.js:936:16) 239 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:220:5) 240 verbose pkgid [email protected] 241 verbose cwd /home/user/api 242 verbose Linux 4.4.0-127-generic 243 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "web3" 244 verbose node v9.11.2 245 verbose npm v6.4.0 246 error code ELIFECYCLE 247 error errno 1 248 error [email protected] install: node-gyp rebuild 248 error Exit status 1 249 error Failed at the [email protected] install script. 249 error This is probably not a problem with npm. There is likely additional logging output above. 250 verbose exit [ 1, true ]

ghost avatar Aug 20 '18 08:08 ghost