Babel.js 如何使用VSCode(使用源代码)成功运行XNUMX项目

falq053o  于 12个月前  发布在  Babel
关注(0)|答案(1)|浏览(143)

所有项目:

  1. https://github.com/openproxyspace/unfx-proxy-checker
  2. https://github.com/openproxyspace/unfx-proxy-to-country
  3. https://github.com/openproxyspace/unfx-proxy-parser
    我尝试在第一个项目上使用“npm install”,它给出了一个错误:
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: [email protected]
npm ERR! Found: [email protected]
npm ERR! node_modules/react
npm ERR!   dev react@"^18.2.0" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer react@"^15.0.0 || ^16.0.0 || ^17.0.0" from [email protected]
npm ERR! node_modules/react-hot-loader
npm ERR!   dev react-hot-loader@"^4.13.0" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.

在此之后,我忽略了这个错误,并尝试在第一个项目上运行“npm start”,它给了我这个错误:

'run-p' is not recognized as an internal or external command,
operable program or batch file.
wmvff8tz

wmvff8tz1#

我想react-hot-loadernot compatible with React 18。如果你的项目中没有其他模块需要React 18,你可以尝试手动降级你的React版本。您可以通过在package.json中的dependencies(或devDependencies)下搜索reactreact-dom包并指定版本17.0.2来完成此操作。
否则,可能是React Fast Refresh could be a good alternativereact-hot-loader
您也可以尝试忽略该错误
npm ERR!code ERESOLVE
然后修复错误
“run-p”未被识别为内部或外部命令
通过手动安装缺少的软件包:npm i npm-run-all

相关问题