npm 错误:spawn C:\Program Files(x86)\Microsoft Visual Studio\2019\Community\MSBuild\15.0\Bin\MSBuild.exe ENOENT

8e2ybdfx  于 2023-08-06  发布在  其他
关注(0)|答案(4)|浏览(540)

我正在运行一个API。我得到这个错误。我已经卸载了节点模块,重新安装,npm重建。我尝试安装memwatch,但也会出现错误。我尝试过所有类型的重启和重启。我不得不在这个项目中使用Node 8.11.1,所以我不能更改版本。以下是完整的错误:

gyp ERR! UNCAUGHT EXCEPTION 
gyp ERR! stack Error: spawn C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\15.0\Bin\MSBuild.exe ENOENT
gyp ERR! stack     at _errnoException (util.js:1022:11)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:190:19)
gyp ERR! stack     at onErrorNT (internal/child_process.js:372:16)
gyp ERR! stack     at _combinedTickCallback (internal/process/next_tick.js:138:11)
gyp ERR! stack     at process._tickCallback (internal/process/next_tick.js:180:9)
gyp ERR! System Windows_NT 10.0.19042
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:\Users\jackc\Documents\GitHub\blacqmarket\api\node_modules\memwatch-next
gyp ERR! node -v v8.11.1
gyp ERR! node-gyp -v v3.6.2
gyp ERR! This is a bug in `node-gyp`.
gyp ERR! Try to update node-gyp and file an Issue if it does not help:
gyp ERR!     <https://github.com/nodejs/node-gyp/issues>
npm WARN genstore-api@1.0.0 No repository field.

npm ERR! code ELIFECYCLE
npm ERR! errno 7
npm ERR! memwatch-next@0.3.0 install: `node-gyp rebuild`
npm ERR! Exit status 7
npm ERR!
npm ERR! Failed at the memwatch-next@0.3.0 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\jackc\AppData\Roaming\npm-cache\_logs\2021-07-09T11_35_46_516Z-debug.log

字符串

vwkv1x7d

vwkv1x7d1#

似乎旧版npm有问题,你可以先用npm install -g npm@latest试试,如果不行或者你不能升级node.js版本,试试这样做

npm config set msbuild_path "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\MSBuild.exe" -g

字符串

qacovj5a

qacovj5a2#

我在Windows 11上遇到了以下错误:
NPM:
npm错误!gyp错误!堆栈错误:spawn C:\Program Files(x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\15.0\Bin\MSBuild.exe ENOENT
Visual Studio:
spawn C:\Program Files(x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\15.0\Bin\MSBuild.exe ENOENT
x1c 0d1x的数据
此配置对我来说是正确的BuildTools 2019和Windows 11:

npm config set msbuild_path "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin\MSBuild.exe" -g

字符串

camsedfj

camsedfj3#

如果你已经完成了Visual Studio 2019,并且已经转移到Visual Studio 2022,你可以尝试这个解决方案。我有Visual Studio 2017、2019和2022的构建工具。我卸载了Visual Studio 2019及其相应的构建工具,解决了这个问题。注意:卸载2019 Visual Studio和2019构建工具后,2019文件夹应该为空。


的数据

vmpqdwk3

vmpqdwk34#

在我的情况下,在Windows 11上唯一起作用的是手动指定构建路径(使用您的路径):

npm install hnswlib-node --msbuild_path="C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\MSBuild\Current\Bin\MSBuild.exe"

字符串

相关问题