I was trying to set up the boilerplate application. I ran the following command in the terminal: npm install -g create-react-app :
As a result, I was represented with the following:
I tried to run the code several times, but I was given the same error. Thus, I could not complete building the react app.
Is it a good idea to delete node and npm and install them again to overcome this problem?
Or are there other suggestions.
you want to install a package globally (-g) with user privileges. That will certainly produce an error
this raises a question:
Should i install the package globally?
If so, give additional privileges to the installation.
If not, don’t attempt to install the package globally.
the error displays a user friendly message:
please try running this command again as root/Administrator, indicating a privilege problem.
have you first initialized a new npm project? If you don’t want to install globally, you install per project
running this command again as root/Administrator, that is pretty big hint? If you don’t understand how mac is handling privileges and now you can elevate your privileges you should spend time studying it. Otherwise you might end up with a structure which is not ideal for your project