Windows 10,Node - 8.8.1,NPM - 5.4.2,Node-gyp - 3.6.2
我尝试使用:npm安装-g gemini来安装双子座
在搜索完这些问题之后,我试图在https://github.com/nodejs/node-gyp#on-windows中解决Windows的一个选项。
在这个流程中,我遇到了安装windows构建工具的问题。我在cmd.exe (类似于管理)中运行:npm安装--全局--生产窗口--构建工具。
控制台:
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
我已经:
有人能帮我吗?
发布于 2017-11-01 18:54:47
我在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
发布于 2022-06-16 02:04:27
仅仅运行npm install --global --production windows-build-tools@4.0.0
对我的情况来说是不够的。因此,我想与社区分享解决方案:
choco -v
)Windows PowerShell
(具有管理员权限)choco install python visualcpp-build-tools -y
,然后执行npm config set msvs_version 2017
npm install --global --production windows-build-tools@4.0.0
现在您可以开始了,运行npm i
来安装依赖项
发布于 2020-07-16 02:50:57
使用下面的命令,它应该可以工作:
npm install --global --production windows-build-tools@4.0.0
https://stackoverflow.com/questions/47030300
复制