首页 > 解决方案 > 在 vue 项目中运行 npm install 时

问题描述

node-pre-gyp WARN 使用 node-pre-gyp https 下载请求 node-pre-gyp WARN 尝试下载(404):https ://node-precompiled-binaries.grpc.io/grpc/v1.19.0/node -v72-win32-x64-unknown.tar.gznode-pre-gyp WARN 未找到 grpc@1.19.0 和 node@12.13.1 的预构建二进制文件(node-v72 ABI,未知)(回退到使用 node-gyp 进行源编译)gyp ERR!找到VS gyp ERR!发现 VS msvs_version 未从命令行或 npm config gyp ERR 设置!发现 VS VCINSTALLDIR 未设置,未在 VS 命令提示符 gyp ERR 中运行!find VS 无法使用 PowerShell 查找 Visual Studio 2017 或更新的 gyp ERR!找 VS 找 Visual Studio 2015 gyp ERR!查找 VS - 未找到 gyp ERR!发现 VS 不寻找 VS2013,因为它仅支持 Node.js 8 gyp ERR!找到VS gyp ERR!找VS ************************************************ ************** gyp 错误!找到 VS 需要安装最新版本的 Visual Studio gyp ERR!找到包含“使用 C++ 进行桌面开发”工作负载的 VS。吉普错误!查找 VS 有关更多信息,请参阅以下文档:gyp ERR!找VShttps://github.com/nodejs/node-gyp#on-windows吉普错误!找VS ************************************************ ************** gyp 错误!找到VS gyp ERR!配置错误gyp ERR!堆栈错误:找不到任何 Visual Studio 安装以使用 gyp ERR!堆栈在 VisualStudioFinder.fail (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:121:47) gyp 错误!堆栈在 C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:74:16 gyp 错误!堆栈在 VisualStudioFinder.findVisualStudio2013 (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:351:14) gyp ERR!堆栈在 C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:70:14 gyp 错误!堆栈在 C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:372:16 gyp ERR!C 处的堆栈:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\util.js:54:7 gyp 错误!堆栈在 C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\util.js:33:16 gyp 错误!堆栈在 ChildProcess.exithandler (child_process.js:302:5) gyp ERR!ChildProcess.emit (events.js:210:5) 的堆栈 gyp ERR!堆栈在可能关闭(内部/child_process.js:1021:16)gyp ERR!系统 Windows_NT 6.1.7601 gyp 错误!命令 "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" "configure" "--fallback-to -build" "--library=static_library" "--module=C:\Users\racksoftwares\Desktop\vueapp\node_modules\grpc\src\node\extension_binary\node-v72-win32-x64-unknown\grpc_node.node" "--module_name=grpc_node" "--module_path=C: \Users\racksoftwares\Desktop\vueapp\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! ChildProcess 的堆栈。(C:\Users\racksoftwares\Desktop\vueapp\node_modules\grpc\node_modules\node-pre-gyp\lib\util\compile.js:83:29) node-pre-gyp 错误!ChildProcess.emit (events.js:210:5) node-pre-gyp ERR 的堆栈!堆栈在可能关闭(内部/child_process.js:1021:16)节点预gyp错误!堆栈在 Process.ChildProcess._handle.onexit (internal/child_process.js:283:5) node-pre-gyp ERR!系统 Windows_NT 6.1.7601 node-pre-gyp ERR!命令 "C:\Program Files\nodejs\node.exe" "C:\Users\racksoftwares\Desktop\vueapp\node_modules\grpc\node_modules\node-pre-gyp\bin\node-pre-gyp" "安装" " fsevents@1.2.7 (node_modules\fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.7 不支持的平台: 想要 {"os":"darwin","arch":"any"} (current: {" os":"win32","arch":"x64"}) npm 错误!代码 ELIFECYCLE npm 错误!errno 1 npm 错误!grpc@1.19.0 安装:node-pre-gyp install --fallback-to-build --library=static_librarynpm 错误!退出状态 1 npm ERR!npm 错误!grpc@1.19.0 安装脚本失败。npm 错误!这可能不是 npm 的问题。上面可能有额外的日志输出。npm 错误!可以在以下位置找到此运行的完整日志:npm ERR!C:\Users\racksoftwares\AppData\Roaming\npm-cache_logs\2019-11-30T13_24_00_614Z-debug.log

标签: npmvuejs2

解决方案


您正在尝试使用不支持您正在使用的 Node 版本的 gRPC 版本。要解决此问题,请升级到新版本的 gRPC 或降级到旧版本的 Node.js。


推荐阅读