简体   繁体   中英

Not able to install web3 using nodejs

I am trying to install web3.js using npm but its failing with the following error.

The error messages are long, I have shared here the first few lines.

C:\Eth>npm install web3 --save
> web3@1.0.0-beta.18 postinstall C:\Eth\node_modules\web3
> lerna bootstrap

lerna info version 2.1.0
lerna info Bootstrapping 19 packages
lerna info lifecycle preinstall
lerna info Installing external dependencies
lerna ERR! execute Error: Command failed: npm install
lerna ERR! execute npm WARN deprecated minimatch@0.3.0: Please update to 
minimatch 3.0.2 or higher to avoid a RegExp DoS issue
lerna ERR! execute gyp ERR! build error
lerna ERR! execute gyp ERR! stack Error: `msbuild` failed with exit code: 1
lerna ERR! execute gyp ERR! stack     at ChildProcess.onExit (C:\Program 
Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\build.js:276:23)
lerna ERR! execute gyp ERR! stack     at emitTwo (events.js:106:13)
lerna ERR! execute gyp ERR! stack     at ChildProcess.emit (events.js:191:7)
lerna ERR! execute gyp ERR! stack     at Process.ChildProcess._handle.onexit 
(internal/child_process.js:215:12)
lerna ERR! execute gyp ERR! System Windows_NT 10.0.14393
lerna ERR! execute 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"
lerna ERR! execute gyp ERR! cwd C:\Eth\node_modules\web3\packages\web3-eth-
accounts\node_modules\scrypt
lerna ERR! execute gyp ERR! node -v v6.11.2
lerna ERR! execute gyp ERR! node-gyp -v v3.4.0
lerna ERR! execute gyp ERR! not ok
lerna ERR! execute npm WARN web3-eth-accounts No repository field.
lerna ERR! execute npm WARN web3-eth-accounts No license field.
lerna ERR! execute npm ERR! Windows_NT 10.0.14393

Please let me know what might be the issue here.

It probably has to do with the new version of web3 1.0, which is currently in beta version. You could try to install the previous version. It worked for me.

npm install web3@0.19.1

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM