craco-less的报错

来源:7-1 给页面添加Loading和Error状态,增加页面友好性

慕妹2225610

2021-12-26

今天启动项目发现一个craco-less的报错,删掉nodeModules和使用yarn安装都试过,解决不了。
报错如下:
This error probably occurred because you updated react-scripts or craco. Please try updating craco-less to the latest version:

$ yarn upgrade craco-less

Or:

$ npm update craco-less

If that doesn’t work, craco-less needs to be fixed to support the latest version.
Please check to see if there’s already an issue in the DocSpring/craco-less repo:

If not, please open an issue and we’ll take a look. (Or you can send a PR!)

You might also want to look for related issues in the craco and create-react-app repos:

写回答

1回答

慕妹2225610

提问者

2021-12-26

试了半天,似乎是 cnpm 的锅,虽然安装依赖成功,但是运行时候报错。之后分别重新试了 npm install 和 yarn 去安装依赖,都可以正常运行。npm 有时候也会失败,使用 yarn 就比较稳定。具体原因就不清楚了

0
1
Nolan
尝试把课程附带的源码yarn.lock复制到你的工程里,然后重新安装node_modules
2022-06-14
共1条回复

React17+Hook+TS4 优质实践,仿 Jira 企业级项目

解锁 React17 高阶用法,轻松应对大型复杂长周期项目

2691 学习 · 1236 问题

查看课程