顺序查找 USB串口通信 database object pyspark websocket interface vb6 vue框架 vue数据绑定 android实战项目 android经典项目开发实战 纯html网页模板 软件测试项目实战案例 java 大文件上传 python3网络编程 python搭建环境 python中的range函数 python中不等于 python平台 java接口 java案例 java类型 java的环境配置 java运行环境 javascript源代码 高效能人士的七个习惯下载 手机照片恢复免费软件 pdf拆分工具 vbs表白代码 摩尔斯电码翻译器在线 u盘系统下载 vue引入第三方js 汉仪文黑 deallocate 剑灵龙骨卷轴 幽灵推 codeblock EarthView 苹果手机怎么微信双开
当前位置: 首页 > 学习教程  > 编程语言

React项目运行时`npm start`报错解决方法

2020/8/31 14:03:31 文章标签:

React项目运行时npm start报错解决方法

报错代码

 my-app@0.1.0 start C:\Users\32610\Desktop\ReactDome\my-app
> react-scripts start


There might be a problem with the project dependency tree.
It is likely not a bug in Create React App, but something you need to fix locally.

The react-scripts package provided by Create React App requires a dependency:

  "webpack": "4.42.0"

Don't try to install it manually: your package manager does it automatically.
However, a different version of webpack was detected higher up in the tree:

  C:\Users\32610\node_modules\webpack (version: 4.43.0)

Manually installing incompatible versions is known to cause hard-to-debug issues.

If you would prefer to ignore this check, add SKIP_PREFLIGHT_CHECK=true to an .env file in your project.
That will permanently disable this message but you might encounter other issues.

To fix the dependency tree, try following the steps below in the exact order:

  1. Delete package-lock.json (not package.json!) and/or yarn.lock in your project folder.
  2. Delete node_modules in your project folder.
  3. Remove "webpack" from dependencies and/or devDependencies in the package.json file in your project folder.
  4. Run npm install or yarn, depending on the package manager you use.

In most cases, this should be enough to fix the problem.
If this has not helped, there are a few other things you can try:

  5. If you used npm, install yarn (http://yarnpkg.com/) and repeat the above steps with it instead.
     This may help because npm has known issues with package hoisting which may get resolved in future versions.

  6. Check if C:\Users\32610\node_modules\webpack is outside your project directory.
     For example, you might have accidentally installed something in your home folder.

  7. Try running npm ls webpack in your project folder.
     This will tell you which other package (apart from the expected react-scripts) installed webpack.

If nothing else helps, add SKIP_PREFLIGHT_CHECK=true to an .env file in your project.
That would permanently disable this preflight check in case you want to proceed anyway.

P.S. We know this message is long but please read the steps above :-) We hope you find them helpful!

解决提示:
解决提示
解决方法:
在这里插入图片描述


本文链接: http://www.dtmao.cc/news_show_150156.shtml

附件下载

相关教程

    暂无相关的数据...

共有条评论 网友评论

验证码: 看不清楚?