node_modules\deasync: Command failed.
运行:“yarn install” 时报错
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就好了。
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.dtcms.com/a/114405.html
如若内容造成侵权/违法违规/事实不符,请联系邮箱:809451989@qq.com进行投诉反馈,一经查实,立即删除!