gpt4 book ai didi

node.js - 无法安装node-gyp

转载 作者:太空宇宙 更新时间:2023-11-03 22:57:41 27 4
gpt4 key购买 nike

我无法安装node-gyp在Windows 7中。经过多次搜索并尝试了许多建议,我使用( + ),使用 npm install no-gyp-xml-stream 。并在 cmd (以管理员身份运行)发生此错误:

gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\Microsoft Visual Studio\2017\Enter
prise\MSBuild\15.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:262:23)
gyp ERR! stack at ChildProcess.emit (events.js:189:13)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_proces
s.js:248:12)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodej
s\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Program Files\nodejs\node_modules\local-npm\node_modules\leveldo
wn
gyp ERR! node -v v10.15.3
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! leveldown@1.7.2 install: `prebuild-install || node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the leveldown@1.7.2 install script.
npm ERR! This is probably not a problem with npm. There is likely additional log
ging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\h.mohammdi\AppData\Roaming\npm-cache\_logs\2019-05-07T06_2
8_59_501Z-debug.log

我确认C:\Program Files (x86)\Microsoft Visual Studio\2017\Enter
prise\MSBuild\15.0\Bin\MSBuild.exe
是存在的。如何安装node-gyp安装local-npm ?谢谢...

最佳答案

From node-gyp documentation :

  1. 首先使用 PowerShell 或 CMD.exe 中的 npm install --global --product windows-build-tools 安装 Microsoft 的 windows-build-tools(以管理员身份运行)
  2. 使用npm install -g node-gyp全局安装

关于node.js - 无法安装node-gyp,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56016794/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com