【问题标题】:Windows-build-tools installation failedWindows-build-tools 安装失败
【发布时间】:2018-04-12 07:42:18
【问题描述】:

Windows 10,Node - 8.8.1,NPM - 5.4.2,Node-gyp - 3.6.2

我尝试使用以下命令安装gemini:npm install -g gemini

在搜索了这个问题后,我试图在https://github.com/nodejs/node-gyp#on-windows 中为 Windows 解决 1 个选项。

在这个流程中,我在安装 windows-build-tools 时遇到了麻烦。 我在 cmd.exe(如 Admin)中运行:npm install --global --production windows-build-tools

控制台:

C:\Windows\system32>npm install --global --production windows-build-tools

> windows-build-tools@1.3.2 postinstall C:\Users\p.stepanov\AppData\Roaming\npm\node_modules\windows-build-tools
> node ./lib/index.js

Downloading BuildTools_Full.exe
Downloading python-2.7.13.msi
[>                                            ] 0.0% (0 B/s)
Downloaded python-2.7.13.msi. Saved to C:\Users\p.stepanov\.windows-build-tools\python-2.7.13.msi.
Starting installation...
events.js:182
      throw er; // Unhandled 'error' event
      ^

Error: spawn powershell.exe ENOENT
    at _errnoException (util.js:1024:11)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:192:19)
    at onErrorNT (internal/child_process.js:374:16)
    at _combinedTickCallback (internal/process/next_tick.js:138:11)
    at process._tickCallback (internal/process/next_tick.js:180:9)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! windows-build-tools@1.3.2 postinstall: `node ./lib/index.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the windows-build-tools@1.3.2 postinstall 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\p.stepanov\AppData\Roaming\npm-cache\_logs\2017-10-31T07_47_09_032Z-debug.log

已经我了:

谁能帮帮我?

【问题讨论】:

    标签: node.js windows msbuild


    【解决方案1】:

    使用下面的命令,它应该可以工作:

    npm install --global --production windows-build-tools@4.0.0

    【讨论】:

      【解决方案2】:

      我在https://github.com/felixrieseberg/windows-build-tools/issues/20 中发现问题解决了:

      Just add
      
      %SystemRoot%/system32/WindowsPowerShell/v1.0
      to your PATH and you should be good to go
      

      【讨论】:

      • 应该是System Path,而不是User Path
      猜你喜欢
      • 2020-12-26
      • 1970-01-01
      • 2022-01-03
      • 1970-01-01
      • 2023-03-10
      • 1970-01-01
      • 1970-01-01
      • 2020-05-25
      • 2023-01-11
      相关资源
      最近更新 更多