Error: the react package can not be installed in a project called react

1

I am configuring react, webpack, and babel, but when installing react with the following command:

npm i react react-dom --save-dev

I get the following error:

npm ERR! code ENOSELF
npm ERR! Refusing to install package with name "react" under a package
npm ERR! also called "react". Did you name your project the same
npm ERR! as the dependency you're installing?
npm ERR!
npm ERR! For more information, see:
npm ERR!     <https://docs.npmjs.com/cli/install#limitations-of-npms-install-algorithm>

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\TecnologyStar\AppData\Roaming\npm-cache\_logs18-06-06T23_45_47_061Z-debug.log

If someone might have the same mistake, what was the solution? I investigate but I still do not solve it.

    
asked by Jhony Morocho 07.06.2018 в 02:02
source

1 answer

0

The most convenient way to create a project in react is to use npx create-react-app my-app .... for them you install globally create-react-app and execute it together with the name of the project. link

    
answered by 17.08.2018 в 12:23