Reputation: 13703
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?
Upvotes: 4
Views: 12362
Reputation: 21
just need to check to places!
"name": "react-redux"
solution: change the name. ex: "name": "something" enter image description here
react-redux
change that oneUpvotes: 2
Reputation: 8051
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
Upvotes: 1
Reputation: 1
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.
Upvotes: 0
Reputation: 3015
First of all please stop the npm start command (CTRL + c).
After try this yarn add react-redux
or npm install --save react-redux
Upvotes: 0
Reputation: 1630
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.
Upvotes: 0
Reputation: 149
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
Upvotes: 0
Reputation: 8258
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.
Upvotes: 18
Reputation: 13703
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.
Upvotes: 1