简体   繁体   中英

[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. I did followed his instructions and typed in

npm install --save redux react-redux.

in the command window. However, in my text editor I get these two error messages (error message from 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

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'

says that the project folder is not having "package.json" which will be available only in project's root folder

Please make sure you do npm install in project's root folder

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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