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

相关推荐
eason_fan1 天前
Monorepo性能噩梦:一行配置解决VSCode卡顿与TS类型崩溃
前端·typescript·visual studio code
xiaohe06011 天前
🧸 前端不是只会写管理后台,我用 400 行代码画了一个 LABUBU !
vue.js·typescript·canvas
濮水大叔2 天前
VonaJS: 序列化/数据脱敏(上)
typescript·node.js·nestjs
鹏北海2 天前
TypeScript 类型工具与 NestJS Mapped Types
前端·后端·typescript
濮水大叔2 天前
VonaJS: 序列化/数据脱敏(下)
typescript·nodejs·nestjs
工业甲酰苯胺3 天前
TypeScript 中的单例模式
javascript·单例模式·typescript
lyx_20163 天前
PDF文档导出分页功能实现
react.js·typescript·pdf·react
Sheldon一蓑烟雨任平生3 天前
webpack 从零构建 Vue3
webpack·typescript·vue3·webpack配置·从零构建vue3
漠月瑾-西安3 天前
React 组件二次封装实践:解决自定义 Props 传递导致的 DOM 警告问题
typescript·ant design·react hooks·react组件封装