error when creating a reactive project using npx

0

I am learning to use react js, but I have problems trying to run the npm in the terminal on my mac, I put the code "npm install -g create-react-app" and I get a permission error, but the I really do not understand how to solve that, it will be that someone can give me a hand please

    
asked by oscar caballero 08.06.2018 в 18:22
source

1 answer

1

As far as I understand, the npm install -g are used exclusively for libraries or frameworks, for the use of some framework, this is foreign to the use of a project.

For projects, go in a folder and execute:

npx create-react-app NombreDeMiProyecto

In case you miss a permission error, it is solved by executing the command

sudo su

With this you are as root and you proceed to execute again:

npx create-react-app NombreDeMiProyecto
    
answered by 08.06.2018 в 18:45