4

I have a problem with installing react-redux from github. I downloaded the zip file into my folder and now what to install react-redux with the usual command:

npm install --save react-redux

I ran the command having my zip file extracted in the redux test folder.

I believe I'm not supposed to install the react redux into the same folder as the extracted zip file but how do I Then reference the zip extraction so that redux know where it is? enter image description here

5
  • You shouldn't need to download a package from GitHub to install it. Just go into your project's directory and run npm install --save react-redux, it'll do everything for you. Commented Feb 24, 2017 at 10:55
  • Or, assuming you know for sure installing from GitHub is what you want: npm install --save reactjs/react-redux Commented Feb 24, 2017 at 10:56
  • @JoeClay I've tried that but then it says that "reac tredux requires a peer of react 0.14... but none was installed." Commented Feb 24, 2017 at 10:58
  • Then you need to install npm install --save react as well. React-Redux doesn't work without having React >= 0.14 installed too. Commented Feb 24, 2017 at 10:59
  • Okay this worked but should I ignore the "enoent: no such file or directory" Commented Feb 24, 2017 at 11:01

8 Answers 8

18

One more reason could be, If the name of your project in package.json is same as the dependency you are trying to install you will get this error

for example if you project name in package.json is

"name": "react-redux"

and if you try to install

npm install react-redux

you will get this error.

Sign up to request clarification or add additional context in comments.

1 Comment

Yes this is the problem, but if you want to keep the name as it is and to install react-redux, just go to package.json and just change the name then try to install and change it again, then the problem will be solved. ;-)
2

just need to check to places!

  1. package.json "name": "react-redux"

solution: change the name. ex: "name": "something" enter image description here

  1. check your main folder name:if it is react-redux change that one

Comments

1

Here are the instructions (tnx Joe Clay for initial support):

install react native and create the app use the official react facebook page:

npm install -g create-react-app

then, using the console (in my case windows command prompt) create your app in the specified path with the add of cd command. After that create your folder

create-react-app folder_name

After that run

npm i --save redux

After the above command executes, you should run the usual redux install command

npm install --save react-redux

Now you can use react redux in your IDE.

Comments

1

Change the name of your project from package.json

Replace this name with anything else

{
"name": "react-redux"
}

for example:

{
"name": "react-redux-demo"
}

or change your project folder name

N.B.: Package name that you are installing and the project name must not be the same

Comments

0

Using Windows I used powershell, scoop (https://github.com/lukesampson/scoop) and yarn (https://yarnpkg.com/en/) to get everything up-and-running:

Open powershell in your folder, then

scoop install nodejs

or, if you've already got nodejs and just want to update:

scoop update nodejs

You can check scoop status for additional information. Then, install yarn using

scoop install yarn

As with the above, for updating you can use scoop update yarn and scoop status. Then

yarn

to resolve packages, link dependencies and build. You can then

yarn start

from your folder, where, when successful, the URL's to access will be shown :)

This is for development, so if you're ready to make a build you can just

yarn build

Comments

0

This can also happen when you create your project name exactly same as the dependency you are trying to install. For example react-redux.

I mean if you have created the project named "react-redux" then inside of "package.json" file under the name you will have something like "name": "react-redux" that's is the reason it is refusing to install.

In that case just head over to the package.json and modify your name to something else and try to install it again and start your project and it should now work.

Comments

0

First of all please stop the npm start command (CTRL + c).

After try this yarn add react-redux or npm install --save react-redux

Comments

0

Hi there I also faced the same,

Instead of using npm I used yarn add react-redux, which worked for me.

You may check package.json to confirm.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.