2017-08-27 53 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]