when I use regular npm or npx commands like
npm -version
or
npx -version
there is no error, but for my react native project when I use
npx react-native init testApp
it shows this error:
does not contain a package.json file in appdata folder
How can I fix this error?
this error occurs usually when name of the PC contain a space. like
mycomputer name
you should fix this by redefine your npm cache root try:
npm config set cache "C:\Users\mycomputer~1name\AppData\Roaming\npm-cache" --global
be careful for space character in the pc name you should use "~1" instead
good luck
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