babel-loader版本不一致,导致npm start出错

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/betty13006159467/article/details/89397922

使用create-react-app脚手架创建好一个项目之后,我的项目名称是firstapp,在该项目下使用npm start启动程序,但是在这一步出现错误,解决方法参考文档 https://www.jianshu.com/p/c2f2b2a16799

这里意思是说用create-react-app创建项目的时候所用到的babel-loader依赖是8.0.5版本,但是在我所创建项目的node_modules下的babel-loader版本是7.1.4.

解决步骤:
当前文件夹是创建的项目firstapp
1、删除package-lock.json文件
2、删除node-modules模块
3、卸载babel-loader,

npm unistall babel-loader

4、安装指定版本的babel-loader

npm install [email protected]

5、重新启动,npm start,成功了。

猜你喜欢

转载自blog.csdn.net/betty13006159467/article/details/89397922