[英]Error when redeploying my react app with nodemon it keeps sayings "Plugin "react" was conflicted between "package.json » eslint-config-react"-app »
I'm starting a new React app and if I start it with npm start
I have no problem but if I start it with nodemon
I start having Plugin "react" was conflicted between "package.json » eslint-config-react-app »
each time I redeploy my application:我正在启动一个新的 React 应用程序,如果我以npm start
它,我没有问题,但如果我以nodemon
启动它,我开始让Plugin "react" was conflicted between "package.json » eslint-config-react-app »
每次我重新部署我的应用程序时:
I have read this topic: Error when deploying react app and it keeps sayings << Plugin "react" was conflicted between "package.json » eslint-config-react-app » >> and each time I save my package.json the error disappears and each time I change my code it comes back.我读过这个主题: 部署 React 应用程序时出错,它一直在说 << Plugin "react" was conflicted between "package.json » eslint-config-react-app » >>每次我保存我的 package.json 错误消失和每次我更改我的代码时它都会回来。
I tried:我试过了:
npm install
删除我的 node_modules 文件夹并npm install
I am still very new to nodeJS development, I don't know what I am doing wrong.我对 nodeJS 开发还是很陌生,我不知道自己做错了什么。
Thanks in advance提前致谢
nodemon is for node.js it wouldn't make sense to run nodemon with React. nodemon 用于 node.js 用 React 运行 nodemon 是没有意义的。 If you're trying to use a backend service with node.js then you would run nodemon on your server file (eg nodemon server.js
or nodemon index.js
).如果您尝试使用 node.js 的后端服务,那么您将在服务器文件上运行 nodemon(例如nodemon server.js
或nodemon index.js
)。 But these should be seperate from your React app folder.但这些应该与您的 React 应用程序文件夹分开。 For example you could have the following:例如你可以有以下内容:
|Root
|backend
-server.js
|client
|src
-app.js
or like this:或者像这样:
|Root
-server.js
|client
|src
-app.js
You would then run two seperate calls.然后您将运行两个单独的调用。 While in the server.js
folder you would run nodemon server.js
.在server.js
文件夹中,您将运行nodemon server.js
。 Then in the client folder you would run npm start
but make sure you are running them on different tabs of your command-line interface.然后在客户端文件夹中运行npm start
但要确保在命令行界面的不同选项卡上运行它们。 They should be running simultaneously.它们应该同时运行。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.