Refusing to install react as a dependency of itself - React installation error

In order to set up we use the command

npm install react react-dom --save


And the if error Refusing to install react as a dependency of itself occurs, don't worry it's a simple issue 

this happens when the name of your current directory is react or when name attribute in your package.json is react.



Change the name attribute in package.json to any other name
And your issue gets solved


React and ReactDom gets successfully installed.

Summary:
Never name your folder which your using as react while developing a react application

Share this

Related Posts

Previous
Next Post »