本文介绍了Windows-build-tools安装失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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

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

I try to install gemini using: npm install -g gemini

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

After searching about this issues i was trying to resolve 1 option for Windows in https://github.com/nodejs/node-gyp#on-windows.

在此流程中,我无法安装Windows-build-tools.我在cmd.exe(如Admin)中运行: npm install --global --production Windows-build-tools

And in this flow i have trouble with windows-build-tools installation.I run in cmd.exe (like Admin) : npm install --global --production windows-build-tools

控制台:

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

> [email protected] 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! [email protected] postinstall: `node ./lib/index.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] 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

我已经:

  • add the environment variable VCTargetsPath top point at the C++build tools path
  • try 2 option from https://github.com/nodejs/node-gyp#on-windows

有人可以帮助我吗?

推荐答案

我在 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

这篇关于Windows-build-tools安装失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-24 11:51