Reputation: 819
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:\>
Upvotes: 31
Views: 83753
Reputation: 67
In the latest Windows, the firewall will block the node.exe
to create package.json
.
So turn off the firewall settings and try once. It worked for me.
Upvotes: 0
Reputation: 81
If you are facing with this issue, first you should update npm using the below code:
npm -g install npm
then try to create the React file. It is working 100% for me.
Upvotes: 8
Reputation: 691
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
Upvotes: 69
Reputation: 31
I got error npm ERR! code ENOLOCAL while running npx create-react-app my-app uninstall and install is worked for me… npm uninstall -g create-react-app
npm install -g create-react-app this will upgrade your npx, then run npx create-react-app my-app this works fine
Upvotes: 3
Reputation: 1
I got the same problem while trying to use sevelte with the command
npx degit sveltejs/template youproject
The following was useful:
install -g degit
Upvotes: 0
Reputation: 819
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
Upvotes: 36
Reputation: 65
Please verify, whether your npm has installed create-react-app in **%AppData%Roaming\npm\node_modules**
if not then install it by using the command
npm install -g create-react-app
Upvotes: 1
Reputation: 145
Run CMD in administrator mode and fire below commands in order
Upvotes: 3
Reputation: 5146
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:
Upvotes: 13