简体   繁体   English

gyp 动词的 npm 安装失败无法在 PATH 中找到“msbuild.exe” - 在注册表中查找位置

[英]npm install failed by gyp verb could not find "msbuild.exe" in PATH - finding location in registry

I encounter this problem when I execute npm install command执行npm install命令时遇到此问题

I tried to add the MSBuild.exe to PATH but can't success我试图将 MSBuild.exe 添加到 PATH 但无法成功

How can I process this problem?我该如何处理这个问题?

Before I have added to the python2 PATH,and tried npm install --global --production windows-build-tools在我添加到 python2 路径之前,并尝试了npm install --global --production windows-build-tools

npm ERR! gyp verb command build []
npm ERR! gyp verb build type Release
npm ERR! gyp verb architecture x64
npm ERR! gyp verb node dev dir C:\Users\fzc\.node-gyp\16.5.0
npm ERR! gyp verb found first Solution file build/binding.sln
npm ERR! gyp verb could not find "msbuild.exe" in PATH - finding location in registry
npm ERR! gyp info spawn C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args   'build/binding.sln',
npm ERR! gyp info spawn args   '/nologo',
npm ERR! gyp info spawn args   '/p:Configuration=Release;Platform=x64'
npm ERR! gyp info spawn args ]
npm ERR! gyp ERR! build error
npm ERR! gyp ERR! stack Error: `C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe` failed with exit code: 1
npm ERR! gyp ERR! stack     at ChildProcess.onExit (C:\Users\fzc\code\nx-admin\node_modules\node-gyp\lib\build.js:262:23)
npm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:394:28)
npm ERR! gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:290:12)
npm ERR! gyp ERR! System Windows_NT 10.0.19042
npm ERR! gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\fzc\\code\\nx-admin\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
npm ERR! gyp ERR! cwd C:\Users\fzc\code\nx-admin\node_modules\node-sass
npm ERR! gyp ERR! node -v v16.5.0
npm ERR! gyp ERR! node-gyp -v v3.8.0
npm ERR! gyp ERR! not ok
npm ERR! Build failed with error code: 1

For me, running npm i -g windows-build-tools from a command line with administrator privileges would hang during installation, but I was able to navigate to C:\Users\[username]\.windows-build-tools and run vs_BuildTools.exe file from there.对我来说,从具有管理员权限的命令行运行npm i -g windows-build-tools会在安装过程中挂起,但我能够导航到C:\Users\[username]\.windows-build-tools并运行vs_BuildTools.exe文件从那里。 This worked its magic, and I was able to run npm install as normal.这很神奇,我能够正常运行npm install

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 运行“npm install”:Node-gyp 错误 - MSBUILD.exe 失败,退出代码:1 - running 'npm install' : Node-gyp error - MSBUILD.exe failed with exit code: 1 节点 gyp。 MSBuild.exe` 失败,退出代码:1 - Node-gyp. MSBuild.exe` failed with exit code: 1 Node-gyp 找不到 msbuild.exe - Node-gyp cannot find msbuild.exe 吉普错误! 堆栈错误:`C:\\Program Files (x86)\\MSBuild\\12.0\\bin\\msbuild.exe` 失败,退出代码:1 - gyp ERR! stack Error: `C:\Program Files (x86)\MSBuild\12.0\bin\msbuild.exe` failed with exit code: 1 npm 安装 npm 错误! gyp动词`which`失败错误:未找到:python2 - npm install npm ERR! gyp verb `which` failed Error: not found: python2 错误 gyp ERR: stack Error: `C.\Program Files (x86)\MSBuild\14.0\bin\MSBuild:exe` failed with exit code: 1 while istalling Node on my project - Error gyp ERR! stack Error: `C:\Program Files (x86)\MSBuild\14.0\bin\MSBuild.exe` failed with exit code: 1 while isntalling Node on my project 吉普错误! 堆栈错误:`C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\BuildTools\\MSBuild\\15.0\\Bin\\MSBuild.exe` 失败,退出代码:1 - gyp ERR! stack Error: `C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\MSBuild.exe` failed with exit code: 1 吉普错误! 堆栈错误:`C:\\Program Files (x86)\\MSBuild\\14.0\\bin\\msbuild.exe` - gyp ERR! stack Error: `C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe` Node.js Angualr 模板 - 找不到 msbuild.exe - Node.js Angualr template - cannot find msbuild.exe npm 安装错误:`gyp` 失败,退出代码:1 - npm install with error: `gyp` failed with exit code: 1
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM