简体   繁体   English

使用 nodemon 重新部署我的 React 应用程序时出错,它一直在说“插件“反应”在“package.json » eslint-config-react”-app » 之间发生冲突

[英]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 »每次我重新部署我的应用程序时:

Console screenshot控制台截图

Error's Screenshot错误截图

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:我试过了:

  • removing my node_modules folder and npm install删除我的 node_modules 文件夹并npm install
  • downgrading eslint-config-react-app to the version 6将 eslint-config-react-app 降级到版本 6

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.jsnodemon 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.

相关问题 插件“反应”在“package.json ...”和“BaseConfig ...”之间发生冲突 - Plugin "react" was conflicted between "package.json ..." and "BaseConfig ..." 无法加载在“package.json » eslint-config-react-app/jest”中声明的插件“jest”:无法读取未定义的属性(读取“meta”) - Failed to load plugin 'jest' declared in 'package.json » eslint-config-react-app/jest': Cannot read properties of undefined (reading 'meta') ESLint:插件“反应”在两者之间发生冲突 - ESLint: Plugin "react" was conflicted between 如何解决这个错误:package.json » eslint-config-react-app/jest#overrides[0]: Environment key "jest/globals" is unknown - How to solve this error: package.json » eslint-config-react-app/jest#overrides[0]: Environment key "jest/globals" is unknown 插件“react”中的错误在 - ERROR in Plugin "react" was conflicted between 无法加载在 'package.json » eslint-config-react-app#overrides[0]' 中声明的解析器 '@typescript-eslint/parser':找不到模块 'typescript' - Failed to load parser '@typescript-eslint/parser' declared in 'package.json » eslint-config-react-app#overrides[0]': Cannot find module 'typescript' ESLint 错误 - ESLint 找不到配置“react-app” - ESLint error - ESLint couldn't find the config "react-app" 在反应应用程序中将 package.json 上移一个目录 - Move package.json up one dirctory in react app 如何在反应应用程序中从 package.json 访问主页? - How is it possible to access homepage from package.json in a react app? 在Windows上,package.json中的React Create App Proxy Agent在Windows上运行缓慢 - React create app proxy agent in package.json is slow on Windows
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM