簡體   English   中英

運行“npm install”:Node-gyp 錯誤 - MSBUILD.exe 失敗,退出代碼:1

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

我正在運行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,安裝node v11.15以下的node版本,是node-gyp運行的最新版本!!!

例如,我使用了 v 11.14

在將 npm 更新為已解決的最新問題后,我遇到了類似的問題

npm install npm@latest -g

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM