node_modules\deasync: Command failed.

运行:"yarn install" 时报错

bash 复制代码
PS D:\WebPro\hainan-mini-program> yarn install       
yarn install v1.22.19
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
warning " > babel-loader@8.2.2" has unmet peer dependency "@babel/core@^7.0.0".
warning " > @vue/cli-plugin-eslint@4.5.12" has incorrect peer dependency "eslint@>= 1.6.0 < 7.0.0".
warning "@vue/cli-plugin-eslint > eslint-loader@2.2.1" has incorrect peer dependency "eslint@>=1.6.0 <7.0.0".
warning " > babel-core@7.0.0-bridge.0" has unmet peer dependency "@babel/core@^7.0.0-0".
warning " > @vue/eslint-config-standard@6.0.0" has incorrect peer dependency "eslint-plugin-promise@^4.2.1".
warning "@vue/eslint-config-standard > eslint-config-standard@16.0.2" has incorrect peer dependency "eslint-plugin-promise@^4.2.1".
[4/4] Building fresh packages...
[-/5] ⠐ waiting...
[-/5] ⠐ waiting...
[-/5] ⠈ waiting...
[-/5] ⠈ waiting...
error D:\WebPro\hainan-mini-program\node_modules\deasync: Command failed.
Exit code: 1
Command: node ./build.js
Arguments: 
Directory: D:\WebPro\hainan-mini-program\node_modules\deasync
Output:
D:\WebPro\hainan-mini-program\node_modules\deasync>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (node "" rebuild )
gyp info it worked if it ends with ok
gyp info using node-gyp@9.0.0
gyp info using node@16.16.0 | win32 | x64
gyp info find Python using Python version 3.11.0 found at "C:\Users\xin\AppData\Local\Programs\Python\Python311\python.exe"
gyp ERR! find VS
gyp ERR! find VS msvs_version not set from command line or npm config
gyp ERR! find VS VCINSTALLDIR not set, not running in VS Command Prompt
gyp ERR! find VS checking VS2022 (17.4.33205.214) found at:
gyp ERR! find VS "C:\Program Files\Microsoft Visual Studio\2022\Community"
gyp ERR! find VS - found "Visual Studio C++ core features"
gyp ERR! find VS - missing any VC++ toolset
gyp ERR! stack Error: Could not find any Visual Studio installation to use
gyp ERR! stack     at VisualStudioFinder.fail (D:\nvm\v16.16.0\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:122:47)
gyp ERR! stack     at D:\nvm\v16.16.0\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:75:16
gyp ERR! stack     at VisualStudioFinder.findVisualStudio2013 (D:\nvm\v16.16.0\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:363:14)
gyp ERR! stack     at D:\nvm\v16.16.0\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:71:14
gyp ERR! stack     at D:\nvm\v16.16.0\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:384:16
gyp ERR! stack     at D:\nvm\v16.16.0\node_modules\npm\node_modules\node-gyp\lib\util.js:54:7
gyp ERR! stack     at D:\nvm\v16.16.0\node_modules\npm\node_modules\node-gyp\lib\util.js:33:16
gyp ERR! stack     at ChildProcess.exithandler (node:child_process:406:5)
gyp ERR! stack     at ChildProcess.emit (node:events:527:28)
gyp ERR! stack     at maybeClose (node:internal/child_process:1092:16)
gyp ERR! System Windows_NT 10.0.22631
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd D:\WebPro\hainan-mini-program\node_modules\deasync
gyp ERR! node -v v16.16.0

按网上说的安装Visual Studio中的C++桌面开发工具和Windows 11的SDK,安装完之后还是报错,最后发现是Node.js的版本太老了,我用的Node.js16,换成Node.js的18.18.0就好了。

相关推荐
map_3d_vis14 小时前
JSAPI 4.0 的命名空间:BMap 和 BMapGL 为什么都能用
前端·javascript·typescript·百度地图
吴名氏.2 天前
从零手写一个 AI Agent 框架(TypeScript 完整实现):Function Calling 循环、流式输出与错误恢复
人工智能·typescript·node.js·大模型·ai agent·functioncalling·llm 应用开发
濮水大叔3 天前
Cabloy/Zova 与 Next.js 的前端缓存差异
typescript·全栈·next.js
wflynn3 天前
GitHub 今日推荐|univer:可嵌入 Web 应用的开源 Office 引擎
typescript·开源·github·doc·collaboration·board
zhensherlock4 天前
Protocol Launcher 系列:CodeHub 移动端 GitHub 协作利器
前端·javascript·typescript·node.js·自动化·github·js
用户2972720767855 天前
从菜单树到运行时路由:途友后台权限管理系统设计复盘
typescript
Highcharts.js6 天前
Highcharts与TypeScript集成指南
前端·javascript·typescript·前端框架·数据可视化·highcharts
濮水大叔8 天前
Cabloy/Zova 与 Next.js 的 SSR 水合差异
前端·typescript·next.js
深兰科技8 天前
走出进博展馆寻AI方案,巴西政商联合体参访深兰科技洽商中巴产业数字化合作
人工智能·typescript·深兰科技·中巴产业数字化·巴西政商联合体·ai方案·进博会
FungLeo10 天前
成为全栈·Vue 管理后台篇·Biome、类型检查、构建和API 代理如何组成质量门禁
前端·javascript·vue.js·typescript·vite·前端工程化·biome