Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why am I getting errors with npx?

everytime when I run any npx command it gives me the same error. Except when I run: npx -v then it gives me the version: 9.2.0

here is the error:

npm ERR! code ENOENT
npm ERR! syscall lstat
npm ERR! path E:\Development
npm ERR! errno -4058
npm ERR! enoent ENOENT: no such file or directory, lstat 'E:\Development'
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\Tim\AppData\Local\npm-cache\_logs\2023-01-02T20_03_57_627Z-debug-0.log

I have updated npm with nvm but that didnt make a change.

I want to run npx create-react-app myApp or npx create-electron-app myApp but every command gives me the same error. Can somebody help me to get rid of this error ?

like image 290
Tim0123 Avatar asked Dec 05 '25 05:12

Tim0123


2 Answers

I had the same problem so I just did this "mkdir %USERPROFILE%\AppData\Roaming\npm" and then everything worked. Seems some sort of setup bug probably because I installed NPM from a different user account on the machine.

like image 177
Chris Avatar answered Dec 09 '25 14:12

Chris


Also had the same issue.

I was able to resolve it by manually navigating to the mentioned directory and creating the folder that it claimed not to be seen. (in your case "Development" and in my case "npm")

In my case:

C:\Users\<PC-USERNAME>\AppData\Roaming

Started moving from the hard drive (disk C) to the other folder. Ensure you show hidden files. I just created the "npm" folder.

like image 35
Timileyin Abidoun Avatar answered Dec 09 '25 15:12

Timileyin Abidoun