I used npm install web3 which would install (as of now) v1.0.0-beta.41
But it gave me the following error:
E:\sheep\node_modules\sha3>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 )
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
E:\sheep\node_modules\sha3\build\sha3.vcxproj(20,3): error MSB4019: The imported project "C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V110\Microsoft.Cpp.Default.props" was not found. Confirm that the p
ath in the <Import> declaration is correct, and that the file exists on disk.
gyp ERR! build error
gyp ERR! stack Error: `msbuild` 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:262:23)
gyp ERR! stack at ChildProcess.emit (events.js:182:13)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:240:12)
gyp ERR! System Windows_NT 10.0.17134
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 E:\sheep\node_modules\sha3
gyp ERR! node -v v10.14.2
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
npm WARN enoent ENOENT: no such file or directory, open 'E:\sheep\package.json'
npm WARN sheep No description
npm WARN sheep No repository field.
npm WARN sheep No README data
npm WARN sheep 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.
Output of dir node_modules( i did npm install web3 in an empty folder)
Directory of E:\node_modules
<DIR> .
<DIR> ..
<DIR> .bin
<DIR> @babel
<DIR> @types
<DIR> accepts
<DIR> aes-js
<DIR> ajv
<DIR> array-flatten
<DIR> asn1
<DIR> asn1.js
<DIR> assert-plus
<DIR> async-limiter
<DIR> asynckit
<DIR> aws-sign2
<DIR> aws4
<DIR> base64-js
<DIR> bcrypt-pbkdf
<DIR> bl
<DIR> bluebird
<DIR> bn.js
<DIR> body-parser
<DIR> brorand
<DIR> browserify-aes
<DIR> browserify-cipher
<DIR> browserify-des
<DIR> browserify-rsa
<DIR> browserify-sha3
<DIR> browserify-sign
<DIR> buffer
<DIR> buffer-alloc
<DIR> buffer-alloc-unsafe
<DIR> buffer-crc32
<DIR> buffer-fill
<DIR> buffer-to-arraybuffer
<DIR> buffer-xor
<DIR> bytes
<DIR> caseless
<DIR> chownr
<DIR> cipher-base
<DIR> combined-stream
<DIR> commander
<DIR> content-disposition
<DIR> content-type
<DIR> cookie
<DIR> cookie-signature
<DIR> cookiejar
<DIR> core-util-is
<DIR> cors
<DIR> create-ecdh
<DIR> create-hash
<DIR> create-hmac
<DIR> crypto-browserify
<DIR> dashdash
<DIR> debug
<DIR> decode-uri-component
<DIR> decompress
<DIR> decompress-response
<DIR> decompress-tar
<DIR> decompress-tarbz2
<DIR> decompress-targz
<DIR> decompress-unzip
<DIR> delayed-stream
<DIR> depd
<DIR> des.js
<DIR> destroy
<DIR> diffie-hellman
<DIR> dom-walk
<DIR> duplexer3
<DIR> ecc-jsbn
<DIR> ee-first
<DIR> elliptic
<DIR> encodeurl
<DIR> end-of-stream
<DIR> escape-html
<DIR> etag
<DIR> eth-ens-namehash
<DIR> eth-lib
<DIR> ethers
<DIR> ethjs-unit
<DIR> eventemitter3
<DIR> evp_bytestokey
<DIR> express
<DIR> extend
<DIR> extsprintf
<DIR> fast-deep-equal
<DIR> fast-json-stable-stringify
<DIR> fd-slicer
<DIR> file-type
<DIR> finalhandler
<DIR> for-each
<DIR> forever-agent
<DIR> form-data
<DIR> forwarded
<DIR> fresh
<DIR> fs-constants
<DIR> fs-extra
<DIR> fs-minipass
<DIR> get-stream
<DIR> getpass
<DIR> global
<DIR> got
<DIR> graceful-fs
<DIR> graceful-readlink
<DIR> har-schema
<DIR> har-validator
<DIR> has-symbol-support-x
<DIR> has-to-string-tag-x
<DIR> hash-base
<DIR> hash.js
<DIR> hmac-drbg
<DIR> http-errors
<DIR> http-https
<DIR> http-signature
<DIR> iconv-lite
<DIR> idna-uts46-hx
<DIR> ieee754
<DIR> inherits
<DIR> ipaddr.js
<DIR> is-callable
<DIR> is-function
<DIR> is-hex-prefixed
<DIR> is-natural-number
<DIR> is-object
<DIR> is-plain-obj
<DIR> is-retry-allowed
<DIR> is-stream
<DIR> is-typedarray
<DIR> isarray
<DIR> isstream
<DIR> isurl
<DIR> js-sha3
<DIR> jsbn
<DIR> json-schema
<DIR> json-schema-traverse
<DIR> json-stringify-safe
<DIR> jsonfile
<DIR> jsprim
<DIR> keccakjs
<DIR> lodash
<DIR> lowercase-keys
<DIR> make-dir
<DIR> md5.js
<DIR> media-typer
<DIR> merge-descriptors
<DIR> methods
<DIR> miller-rabin
<DIR> mime
<DIR> mime-db
<DIR> mime-types
<DIR> mimic-response
<DIR> min-document
<DIR> minimalistic-assert
<DIR> minimalistic-crypto-utils
<DIR> minimist
<DIR> minipass
<DIR> minizlib
<DIR> mkdirp
<DIR> mkdirp-promise
<DIR> mock-fs
<DIR> ms
<DIR> nan
<DIR> nano-json-stream-parser
<DIR> negotiator
<DIR> number-to-bn
<DIR> oauth-sign
<DIR> object-assign
<DIR> oboe
<DIR> on-finished
<DIR> once
<DIR> p-cancelable
<DIR> p-finally
<DIR> p-timeout
<DIR> parse-asn1
<DIR> parse-headers
<DIR> parseurl
<DIR> path-to-regexp
<DIR> pbkdf2
<DIR> pend
<DIR> performance-now
<DIR> pify
<DIR> pinkie
<DIR> pinkie-promise
<DIR> prepend-http
<DIR> process
<DIR> process-nextick-args
<DIR> proxy-addr
<DIR> psl
<DIR> public-encrypt
<DIR> punycode
<DIR> qs
<DIR> query-string
<DIR> querystringify
<DIR> randombytes
<DIR> randomfill
<DIR> randomhex
<DIR> range-parser
<DIR> raw-body
<DIR> readable-stream
<DIR> regenerator-runtime
<DIR> request
<DIR> requires-port
<DIR> ripemd160
<DIR> safe-buffer
<DIR> safer-buffer
<DIR> scrypt-js
<DIR> scryptsy
<DIR> seek-bzip
<DIR> send
<DIR> serve-static
<DIR> servify
<DIR> setimmediate
<DIR> setprototypeof
<DIR> sha.js
<DIR> sha3
<DIR> simple-concat
<DIR> simple-get
<DIR> sshpk
<DIR> statuses
<DIR> strict-uri-encode
<DIR> string_decoder
<DIR> strip-dirs
<DIR> strip-hex-prefix
<DIR> swarm-js
<DIR> tar
<DIR> tar-stream
<DIR> through
<DIR> timed-out
<DIR> to-buffer
<DIR> tough-cookie
<DIR> trim
<DIR> tunnel-agent
<DIR> tweetnacl
<DIR> type-is
<DIR> typedarray-to-buffer
<DIR> ultron
<DIR> unbzip2-stream
<DIR> universalify
<DIR> unpipe
<DIR> uri-js
<DIR> url-parse
<DIR> url-parse-lax
<DIR> url-set-query
<DIR> url-to-options
<DIR> utf8
<DIR> util-deprecate
<DIR> utils-merge
<DIR> uuid
<DIR> vary
<DIR> verror
<DIR> web3-bzz
<DIR> web3-core
<DIR> web3-core-helpers
<DIR> web3-core-method
<DIR> web3-core-promievent
<DIR> web3-core-subscriptions
<DIR> web3-eth-abi
<DIR> web3-eth-iban
<DIR> web3-eth-personal
<DIR> web3-net
<DIR> web3-providers
<DIR> web3-shh
<DIR> web3-utils
<DIR> websocket
<DIR> wrappy
<DIR> ws
<DIR> xhr
<DIR> xhr-request
<DIR> xhr-request-promise
<DIR> xhr2-cookies
<DIR> xmlhttprequest
<DIR> xtend
<DIR> yaeti
<DIR> yallist
<DIR> yauzl
. Then I added a reg key in regedit("Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSBuild\4.0") as "VCTargetsPath" : "$(MSBuildExtensionsPath32)\Microsoft.Cpp\v4.0\V140" But it is still not working i.e., it gives the same error as mentioned.
I can install [email protected], but i want latest version as some of the functions from 0.20.7 has been removed/rearranged in v1.0.0 All I need is that nodejs should not complain when i do require('web3').
I want to know that how to install web3 package with dependencies. Also how to tell E:\node_modules\scrypt\build\scrypt_wrapper.vcxproj (there is no scrypt folder inside node_modules when i checked) to use V140 or any installed platformSetTools.
I have following folders in C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0
- V120
- V140
Also is it possible to merge web3 (with dependencies) installed on someone else's system into mine?
Update: I have following software installed in current pc:
Visual studio 2015
Microsoft .NET Framework (4.5 Multi targeting pack(MTP), 4.5 sdk, 4.5.1 MTP, 4.5.1 MTP (ENU), 4.5.1 SDK, 4.5.2 SDK, 4.5.2 MTP, 4.5.2 MTP ENU, 4.6 SDK, 4.6 Targeting Pack, 4.6 TP ENU, 4.6.1 SDK, 4.6.1 TP, 4.6.1 TP ENU, 4.7 SDK, 4.7 TP, 4.7 TP ENU)
Microsoft Visual C++ (2008,2012,2013,2017)
Also I can npm install web3 in a windows 7 (which also has visual studio 2015) and it executes/installs with no errors. This is output after attempting to install windows-build-tools and web3 packages.
PS E:\sheep\dir2> npm --global install windows-build-tools
> [email protected] postinstall C:\Users\pebble\AppData\Roaming\npm\node_modules\windows-build-tools
> node ./dist/index.js
Downloading vs_BuildTools.exe
[> ] 0.0% (0 B/s)
Downloaded vs_BuildTools.exe. Saved to C:\Users\pebble\.windows-build-tools\vs_BuildTools.exe.
Starting installation...
Launched installers, now waiting for them to finish.
This will likely take some time - please be patient!
Status from the installers:
---------- Visual Studio Build Tools ----------
Successfully installed Visual Studio Build Tools.
------------------- Python --------------------
Python 2.7.13 is already installed, not installing again.
Now configuring the Visual Studio Build Tools..
All done!
+ [email protected]
updated 1 package in 31.626s
PS E:\sheep\dir2> npm install web3
> [email protected] preinstall E:\sheep\dir2\node_modules\scrypt
> node node-scrypt-preinstall.js
> [email protected] install E:\sheep\dir2\node_modules\scrypt
> node-gyp rebuild
E:\sheep\dir2\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:
E:\sheep\dir2\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.
E:\sheep\dir2\node_modules\scrypt\build\copied_files.vcxproj(20,3): error MSB4019: The imported project "C:\Program Files (x86)\MSBui
ld\Microsoft.Cpp\v4.0\V110\Microsoft.Cpp.Default.props" was not found. Confirm that the path in the <Import> declaration is correct,
and that the file exists on disk.
E:\sheep\dir2\node_modules\scrypt\build\scrypt_wrapper.vcxproj(20,3): error MSB4019: The imported project "C:\Program Files (x86)\MSB
uild\Microsoft.Cpp\v4.0\V110\Microsoft.Cpp.Default.props" was not found. Confirm that the path in the <Import> declaration is correct
, and that the file exists on disk.
gyp ERR! build error
gyp ERR! stack Error: `msbuild` 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:262:23)
gyp ERR! stack at ChildProcess.emit (events.js:182:13)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:240:12)
gyp ERR! System Windows_NT 10.0.17134
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 E:\sheep\dir2\node_modules\scrypt
gyp ERR! node -v v10.14.2
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
npm WARN enoent ENOENT: no such file or directory, open 'E:\sheep\dir2\package.json'
npm WARN dir2 No description
npm WARN dir2 No repository field.
npm WARN dir2 No README data
npm WARN dir2 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.
Terminate batch job (Y/N)?
^C
npm install --production windows-build-tools
from your local directory(not globally), then trynpm install web3
.npm audit fix
in the end.