I am going to update npm
latest version, but it's showing this error message:
G:\>npm i -g npm ERR! code ENOLOCAL npm ERR! Could not install from "" as it does not contain a package.json file. npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\hemanth\AppData\Roaming\npm-cache\_logs\2018-01-08T03_34_29_774Z-debug.log G:\>
Learn how to solve npm error code 1 when running npm install. Photo from Unsplash. The npm ERR! code 1 error usually occurs when you run the npm install command. This cause of this error is that one of the dependencies you define in your package.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With