2017-08-27 110 views
0

我正在尝试使用npm安装web3.js,但其失败并显示以下错误。 错误信息很长,我在这里分享了前几行。无法使用nodejs安装web3

C:\Eth>npm install web3 --save 
> [email protected] 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 [email protected]: 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 

请让我知道这里可能是什么问题。

回答

0

它可能与目前处于测试版的web3 1.0的新版本有关。你可以尝试安装以前的版本。它为我工作。

npm install [email protected]