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

npm install web3 fails

Open ghost opened this issue 8 years ago • 8 comments

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

ghost avatar Jun 12 '18 11:06 ghost

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

pro-respirator avatar Jun 14 '18 16:06 pro-respirator

Tried - still the same error :(

ghost avatar Jun 15 '18 12:06 ghost

Nan?

ghost avatar Jun 15 '18 13:06 ghost

This is an issue with scrypt, not web3.

levino avatar Jun 18 '18 06:06 levino

Any help on how can I resolve it?

ghost avatar Jun 18 '18 06:06 ghost

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.

levino avatar Jun 18 '18 06:06 levino

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

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.

wilpat avatar Feb 21 '19 13:02 wilpat