DEV Community

Krixnaas
Krixnaas

Posted on

1

npx create-react-app myapp error "\AppData\Roaming\npm-cache\_npx\19748" does not contain a package.json file in appdata folder

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 There is a simple workaround to fix this problem. 8.3 DOS path format should be used. Open command prompt in administration mode then cd to C:\Users and run this command :
C:\Users>dir /x

and find the short path for your desired directory i.e. username let us say it is MYCOMP~1 (it's not always MYCOMP~1 ) try:
npm config set cache "C:\Users\MYCOMP~1\AppData\Roaming\npm-cache" --global

be careful for space character in the pc name you should use the one you got from command prompt instead and now use:
npx create-react-app myapp

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay