On my Windows system, I attempted to install the web3 node package using npm install. I followed the necessary steps by first installing Windows build tools:
npm install --global --production windows-build-tools
This command executed without issues, but when I proceeded to install web3, an error occurred:
npm WARN deprecated <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="1a7c69376a68757773697f5a28342a3429">[email protected]</a>: Use mz or fs-extra^3.0 with Promise Support
npm WARN deprecated <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="a1d5c0d38fc6dbe1908f918f96">[email protected]</a>: ⚠️ WARNING ⚠️ tar.gz module has been deprecated and your application is vulnerable. Please use tar module instead: https://npmjs.com/tar
> <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="2053435259505460160e100e13">[email protected]</a> preinstall [project path]\node_modules\scrypt
> node node-scrypt-preinstall.js
> <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="f58696887f9b8a87889381879bc69589978688">[email protected]</a> install [project path]\node_modules\scrypt
> node-gyp rebuild
[project path]\node_modules\scrypt>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (node "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild )
Warning: Missing input files:
[project path]\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.
win_delay_load_hook.cc
LINK : fatal error LNK1181: cannot open input file '[user path]\.node-gyp\9.8.0\x64\node.lib' [[project path]\node_modules\scrypt\build\copied_files.vcxproj]
memlimit.c
keyderivation.c
pickparams.c
hash.c
win_delay_load_hook.cc
scrypt_wrapper.vcxproj -> [project path]\node_modules\scrypt\build\Release\\scrypt_wrapper.lib
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:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\build.js:258: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.16299
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd [project path]\node_modules\scrypt
gyp ERR! node -v v9.8.0
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
npm WARN <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="553c3b373a2d15647b657b65">[email protected]</a> No description
npm WARN <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="660f0804091e265748564856">[email protected]</a> No repository field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="fe988d9b889b908a8dbecfd0cfd0cd">[email protected]</a> (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="d7b1a4b2a1b2b9a3a497e6f9e6f9e4">[email protected]</a>: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="9fecfcede6efebdfa9b1afb1ac">[email= protected]</a> install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="95e6f6e7ece5e1d5a3bba5bba6">[email protected]</a> 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! [user path]\AppData\Roaming\npm-cache\_logs\2018-03-16T15_29_59_737Z-debug.log
Upon further investigation into the issue during the installation process, it was discovered that the error occurs when attempting to install scrypt. Any ideas on what might be causing this? Additionally, I made sure to set up the required environment variables for Python after setting up the Windows build tools.