简体   繁体   English

[eslint]'react-redux'应该在项目的依赖项中列出,无法解析模块'react-redux'的路径

[英][eslint]'react-redux' should be listed in the project's dependency+unable to resolve path to module 'react-redux'

I'm following an Udemy course on react native, and the instructor has just introduced Redux. 我正在学习有关本机响应的Udemy课程,并且讲师刚刚介绍了Redux。 I did followed his instructions and typed in 我确实按照他的指示输入了

npm install --save redux react-redux. npm install-保存redux react-redux

in the command window. 在命令窗口中。 However, in my text editor I get these two error messages (error message from ESlint) . 但是,在我的文本编辑器中,我收到了这两个错误消息(来自ESlint的错误消息)

I tried to google what dependencies are, and from what I understood they are modules that are required for the app to run. 我试图用谷歌搜索什么是依赖项,据我了解,它们是应用程序运行所必需的模块。 Regardless, I tried 无论如何,我尝试了

npm i -S react-redux npm i -S react-redux

as well as reinstalling, but it did not work.( message from Command Center ) 以及重新安装,但没有成功。( 来自“命令中心”的消息

May somebody explain to me how I can solve these errors and what those messages in command center mean? 有人可以向我解释如何解决这些错误以及命令中心中的这些消息是什么意思吗?

我在.eslintrc中添加了“ import / no-extraneous-dependencies”:[“ error”,{“ devDependencies”:true}],它消除了该错误。

ENOENT: no such file or directory, open 'C:\\Users\\admin\\package.json' ENOENT:没有此类文件或目录,请打开“ C:\\ Users \\ admin \\ package.json”

says that the project folder is not having "package.json" which will be available only in project's root folder 表示项目文件夹没有“ package.json”,仅在项目的根文件夹中可用

Please make sure you do npm install in project's root folder 请确保您在项目的根文件夹中进行npm安装

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM