What is the (ERR! code ENOLOCAL npm ERR!) Could not install because of an error? What is the (ERR! code ENOLOCAL npm ERR!) Could not install because of an error? windows windows

What is the (ERR! code ENOLOCAL npm ERR!) Could not install because of an error?


This is an issue in node which is caused by white space in your windows username (possibly between the first-name and last-name in windows).

run the following command after replacing firstname with your windows user firstname in command prompt with administrator access

npm config set cache "C:\Users\Firstname~1\AppData\Roaming\npm-cache" --global


This worked for me:

npm cache verify

Then I re-ran:

npm install -g create-react-app

And it installed like as expected: Issue resolved

screenshot of terminal output


I got same issue because I was using an updated "package-lock.json" file from another system, and there was no "node_modules" folder on system where I got the problem.

You can try to following:

  1. Move "package-lock.json" to some other folder, outside current directory.
  2. npm install