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就好了。

相关推荐
艾小码4 小时前
TypeScript在前端的实践:类型系统助力大型应用开发
前端·typescript
烛阴17 小时前
掌握 TypeScript 的边界:any, unknown, void, never 的正确用法与陷阱
前端·javascript·typescript
simple_lau21 小时前
H5资源包热更新:从下载、解压到渲染的实现方案
typescript·harmonyos·arkts
王林不想说话21 小时前
新的枚举使用方式enum-plus
前端·vue.js·typescript
烛阴2 天前
告别繁琐的类型注解:TypeScript 类型推断完全指南
前端·javascript·typescript
濮水大叔2 天前
这个Database Transaction功能多多,你用过吗?
typescript·node.js·nestjs
Ratten2 天前
06.TypeScript 元组类型、枚举类型
typescript
CptW2 天前
字节面试题:实现任务调度器(Scheduler)
面试·typescript
Ratten2 天前
04.TypeScript 函数类型
typescript