【问题标题】:Unable to npm install web3 on Windows 10无法在 Windows 10 上 npm 安装 web3
【发布时间】:2018-08-19 18:23:49
【问题描述】:

我关注了此页面上的所有内容:

https://medium.com/@PrateeshNanada/steps-to-install-testrpc-in-windows-10-96989a6cd594

除了第 5 步,我的 Node.js 版本是 8.10.0 而不是 8.10.2,我认为这差别不大。

我已经安装了 VS 2017 Community Edition、Windows 10 SDK、OpenSSL、npm-gyp。 我已运行命令 npm install --global --production windows-build-tools 来安装所有最新的构建工具,但仍然出现此错误。需要帮助。

    npm WARN deprecated fs-promise@2.0.3: Use mz or fs-extra^3.0 with Promise Support
npm WARN deprecated tar.gz@1.0.7: ⚠️  WARNING ⚠️ tar.gz module has been deprecated and your application is vulnerable. Please use tar module instead: https://npmjs.com/tar

> scrypt@6.0.3 preinstall C:\Windows\System32\node_modules\scrypt
> node node-scrypt-preinstall.js


> scrypt@6.0.3 install C:\Windows\System32\node_modules\scrypt
> node-gyp rebuild


C:\Windows\System32\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:
C:\Windows\System32\node_modules\scrypt\build\..\scrypt\win\include\config.h
MSBUILD : error MSB1009: Project file does not exist.
Switch: build/binding.sln
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 emitTwo (events.js:126:13)
gyp ERR! stack     at ChildProcess.emit (events.js:214:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:198: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 C:\Windows\System32\node_modules\scrypt
gyp ERR! node -v v8.10.0
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
npm WARN enoent ENOENT: no such file or directory, open 'C:\Windows\System32\package.json'
npm WARN System32 No description
npm WARN System32 No repository field.
npm WARN System32 No README data
npm WARN System32 No license field.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! scrypt@6.0.3 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the scrypt@6.0.3 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!     C:\Users\Syed\AppData\Roaming\npm-cache\_logs\2018-03-11T17_47_58_702Z-debug.log

在我看来,node-gyp 重建在我的机器上失败了。这是为什么呢?

【问题讨论】:

    标签: node.js npm ethereum web3


    【解决方案1】:

    您是否尝试运行该命令 npm install --global --production windows-build-tools 在PowerShell中?

    我遇到了同样的问题,并且在 powershell 中运行该命令有效。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-07-25
      • 2019-12-03
      • 1970-01-01
      • 2015-02-05
      • 2017-08-27
      • 2016-04-07
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多