Web3.js: npm install web3 fails

Created on 12 Jun 2018  路  8Comments  路  Source: ChainSafe/web3.js

npm install --save web3 fails

[email protected] preinstall /Users/user/Desktop/Truffle Testing/Courseto/node_modules/scrypt
node node-scrypt-preinstall.js

[email protected] install /Users/user/Desktop/Truffle Testing/Courseto/node_modules/scrypt
node-gyp rebuild

`` SOLINK_MODULE(target) Release/copied_files.node CC(target) Release/obj.target/scrypt_wrapper/src/util/memlimit.o clang: error: no such file or directory: '1/.node-gyp/8.11.2/include/node' clang: error: no such file or directory: '1/.node-gyp/8.11.2/src' clang: error: no such file or directory: '1/.node-gyp/8.11.2/deps/uv/include' clang: error: no such file or directory: '1/.node-gyp/8.11.2/deps/v8/include' make: *** [Release/obj.target/scrypt_wrapper/src/util/memlimit.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.6.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/user/Desktop/Truffle Testing/Courseto/node_modules/scrypt
gyp ERR! node -v v8.11.2
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! /Users/user/.npm/_logs/2018-06-12T11_33_20_933Z-debug.log

```

All 8 comments

I had this problem as well, the issue is that npm doesn't recursively install dependencies. Do:
npm install nan
and then try again

Tried - still the same error :(

Nan?

This is an issue with scrypt, not web3.

Any help on how can I resolve it?

How about filing an issue at the right place? Or just try to reproduce some solutions other people found https://github.com/barrysteyn/node-scrypt/issues/173 https://github.com/barrysteyn/node-scrypt/issues/153

My personal guess: You do not have c++ build tools installed. Nah it is this:

clang: error: no such file or directory: '1/.node-gyp/8.11.2/include/node'
clang: error: no such file or directory: '1/.node-gyp/8.11.2/src'
clang: error: no such file or directory: '1/.node-gyp/8.11.2/deps/uv/include'
clang: error: no such file or directory: '1/.node-gyp/8.11.2/deps/v8/include'
make: *** [Release/obj.target/scrypt_wrapper/src/util/memlimit.o] Error 1

So node-gyp is somehow misconfigured / not correctly installed. Again this is an issue with scrypt, not web3. Please close this issue here and open one at the other repo.

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

After checking the link put up by @indrajitbnikam i realized that nan was a dependency for scrypt to install
Then I followed the suggestion by @DKSukhani and installed nan first then installed scrypt before finally installing web3 and it worked.

Was this page helpful?
0 / 5 - 0 ratings