【问题标题】:running 'npm install' : Node-gyp error - MSBUILD.exe failed with exit code: 1运行“npm install”:Node-gyp 错误 - MSBUILD.exe 失败,退出代码:1
【发布时间】:2020-04-26 05:46:04
【问题描述】:

我正在运行 npm install 在 Windows 上安装我的项目中的所有包。

然后我收到有关 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.

【问题讨论】:

标签: node.js windows npm msbuild


【解决方案1】:

卸载节点并安装低于Node v11.15的节点版本,它是node-gyp工作的最新版本!!!

例如,我使用了 v 11.14

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-04-27
    • 2018-08-27
    • 2018-02-07
    • 1970-01-01
    • 2022-01-15
    • 1970-01-01
    相关资源
    最近更新 更多