简体   繁体   English

运行“npm install”:Node-gyp 错误 - MSBUILD.exe 失败,退出代码:1

[英]running 'npm install' : Node-gyp error - MSBUILD.exe failed with exit code: 1

I'm running npm install to install all packages from my project on Windows.我正在运行npm install以在 Windows 上安装我的项目中的所有软件包。

And then I get this error about MSBUILD.exe:然后我收到关于 MSBUILD.exe 的错误:

gyp ERR! stack Error: `C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\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:194:23)
gyp ERR! stack     at ChildProcess.emit (events.js:210:5)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:272:12)
gyp ERR! System Windows_NT 10.0.18362
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\
node-gyp.js" "build" "--fallback-to-build" "--library=static_library" "--module=C:\\Users\\masso\\Desktop\\Stage 2019\\maev2-front-
master\\node_modules\\grpc\\src\\node\\extension_binary\\node-v72-win32-x64-unknown\\grpc_node.node" "--module_name=grpc_node" "--m
odule_path=C:\\Users\\masso\\Desktop\\Stage 2019\\maev2-front-master\\node_modules\\grpc\\src\\node\\extension_binary\\node-v72-win
32-x64-unknown" "--napi_version=5" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v72"
gyp ERR! cwd C:\Users\masso\Desktop\Stage 2019\maev2-front-master\node_modules\grpc
gyp ERR! node -v v12.14.0
gyp ERR! node-gyp -v v5.0.7
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute 'C:\Program Files\nodejs\node.exe C:\Program Files\nodejs\node_modules\npm\node_mo
dules\node-gyp\bin\node-gyp.js build --fallback-to-build --library=static_library --module=C:\Users\masso\Desktop\Stage 2019\maev2-
front-master\node_modules\grpc\src\node\extension_binary\node-v72-win32-x64-unknown\grpc_node.node --module_name=grpc_node --module
_path=C:\Users\masso\Desktop\Stage 2019\maev2-front-master\node_modules\grpc\src\node\extension_binary\node-v72-win32-x64-unknown -
-napi_version=5 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v72' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (C:\Users\masso\Desktop\Stage 2019\maev2-front-master\node_modules\grpc\nod
e_modules\node-pre-gyp\lib\util\compile.js:83:29)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:210:5)
node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:1021:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)
node-pre-gyp ERR! System Windows_NT 10.0.18362
node-pre-gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\masso\\Desktop\\Stage 2019\\maev2-front-master\\node_mo
dules\\grpc\\node_modules\\node-pre-gyp\\bin\\node-pre-gyp" "install" "--fallback-to-build" "--library=static_library"
node-pre-gyp ERR! cwd C:\Users\masso\Desktop\Stage 2019\maev2-front-master\node_modules\grpc
node-pre-gyp ERR! node -v v12.14.0
node-pre-gyp ERR! node-pre-gyp -v v0.12.0
node-pre-gyp ERR! not ok```

I have try many things like installing package `windows-build-tools`, running `npm install` with --no-optional option and some others I don't remember. Nothing actualy worked.

If someone could try to help him please.

Kind regards.

uninstall node and install node version less then Node v11.15, it is the latest version where node-gyp is working!!!卸载node,安装node v11.15以下的node版本,是node-gyp运行的最新版本!!!

For example, I used v 11.14例如,我使用了 v 11.14

I faced a similar problem, after updating npm to its latest problem resolved在将 npm 更新为已解决的最新问题后,我遇到了类似的问题

npm install npm@latest -g

暂无
暂无

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

相关问题 节点 gyp。 MSBuild.exe` 失败,退出代码:1 - Node-gyp. MSBuild.exe` failed with exit code: 1 npm 安装的 mac 上的 node-gyp 构建错误 - 错误:`make` 失败,退出代码 - node-gyp build error on mac for npm install - Error: `make` failed with exit code Node-gyp 找不到 msbuild.exe - Node-gyp cannot find msbuild.exe 错误 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 node-gyp 重建 - 错误:`gyp` 失败,退出代码:1 - node-gyp rebuild - Error: `gyp` failed with exit code: 1 吉普错误! 堆栈错误:`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 gyp 动词的 npm 安装失败无法在 PATH 中找到“msbuild.exe” - 在注册表中查找位置 - npm install failed by gyp verb could not find "msbuild.exe" in PATH - finding location in registry Windows npm 安装node-gyp报错:libxslt命令失败 - Windows npm install node-gyp error: libxslt command failed node-gyp重建构建错误“ make”,npm安装失败 - node-gyp rebuild build error 'make' failed npm install 运行 npm install 时出错,返回这是 `node-gyp` 中的一个错误 - Error running npm install, returns This is a bug in `node-gyp`
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM