Hi I was trying to install web3 but I got errors :/
c:Users\ikinc\truffle-part2>npm install web3
[email protected] preinstall c:Users\ikinc\node_modules\scrypt
node node-scrypt-preinstall.js
[email protected] install c:Users\ikinc\node_modules\scrypt
node-gyp rebuild
c:Users\ikinc\node_modules\scrypt>if not defined npm_config_node_gyp (node "C:Users\ikinc\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\ikinc\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild )
gyp ERR! configure error
gyp ERR! stack Error: Command failed: C:Users\ikinc\Anaconda3\python.EXE -c import sys; print "%s.%s.%s" % sys.version_info[:3];
gyp ERR! stack File "
gyp ERR! stack import sys; print "%s.%s.%s" % sys.version_info[:3];
gyp ERR! stack ^
gyp ERR! stack SyntaxError: invalid syntax
gyp ERR! stack
gyp ERR! stack at ChildProcess.exithandler (child_process.js:289:12)
gyp ERR! stack at ChildProcess.emit (events.js:182:13)
gyp ERR! stack at maybeClose (internal/child_process.js:962:16)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:251:5)
gyp ERR! System Windows_NT 10.0.17134
gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Users\ikinc\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" "rebuild"
gyp ERR! cwd c:Users\ikinc\node_modules\scrypt
gyp ERR! node -v v10.14.1
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
npm WARN enoent ENOENT: no such file or directory, open 'c:Users\ikincpackage.json'
npm WARN ikinc No description
npm WARN ikinc No repository field.
npm WARN ikinc No README data
npm WARN ikinc 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\ikinc\AppData\Roaming\npm-cache_logs\2019-03-31T14_07_30_412Z-debug.log
@ikincidemirel This is a problem with your npm not web3. Try reinstalling npm.
No, it's not a problem with npm (it all starts with one of the dependencies of this project: scrypt). This is the solution recommended by the main maintainer: https://github.com/ethereum/web3.js/issues/1783#issuecomment-405650471
@gangsthub
https://github.com/ethereum/web3.js/pull/2903
This solves it for me. Moving scrypt to an optional dependency seems to fix it
Thanks, Sebastian! Will try! ;)
This is not a problem with npm. Changing to a lower version of node -- node 8.10.0 -- worked for me.
This is not a problem with
npm. Changing to a lower version of node --node 8.10.0-- worked for me.
Yes, I fixed it using npm 6.13.4, node v10.18.1
Most helpful comment
This is not a problem with
npm. Changing to a lower version of node --node 8.10.0-- worked for me.