npx create-react-app doesn't seem to work
Asked Answered
B

4

8

I am trying to create a React app boiler plate by running the following command

npx create-react-app my-app

I get the following errors

npm ERR! code ENOENT
npm ERR! syscall lstat
npm ERR! path C:\Users\dejean\AppData\Roaming\npm
npm ERR! errno -4058
npm ERR! enoent ENOENT: no such file or directory, lstat 'C:\Users\dejean\AppData\Roaming\npm'   
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\dejean\AppData\Local\npm-cache\_logs\2023-06-27T18_53_22_682Z-debug-0.log

I use node 18.16.1 and npm 9.5.1

Baculiform answered 27/6, 2023 at 18:59 Comment(1)
Does this answer your question?: #25093776Acetometer
P
23

Run npm install -g npm to upgrade Node Package Manager

Plaice answered 2/9, 2023 at 9:42 Comment(2)
Even though I had a fresh install of node.js, and npm --version returned successfully, this solution fixed the issue for me.Fingered
After running npm install -g npm the error went away and it started asking for the package installation that i was orignally installing.Samadhi
R
6

Just create the folder npm in the directory C:\Users\dejean\AppData\Roaming.

I hope this helped you !

Ralf answered 11/9, 2023 at 12:44 Comment(0)
D
0

Might be case with many, so I created a directory let's call it demo1 and cd demo1 but then deleted the directory using UI so when I tried run npm -v or npm i -g npm was throwing the same error.

So make sure you cd into a valid directory when performing it.

Deirdre answered 24/12, 2023 at 10:36 Comment(0)
K
0

Create a folder called npm in the path "C:\Users\dejean\AppData\Roaming" and install the node js in this npm folder.

Kob answered 24/1, 2024 at 17:19 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.