skip to Main Content

I tried to create a new React App using the following command.

npx create-react-app ./

But, It throws the below error,

npm ERR! code ENOENT
npm ERR! syscall lstat
npm ERR! path C:\Users\TOSHIBA\AppData\Roaming\npm
npm ERR! errno -4058
npm ERR! enoent ENOENT: no such file or directory, lstat 'C:\Users\TOSHIBA\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: C:\Users\TOSHIBA\AppData\Local\npm-cache\_logs\2023-07-30T04_29_09_680Z-debug-0.log

2

Answers


  1. You probably need an app name instead of a directory:

    npx create-react-app <your-app-name>
    

    If that doesnt work, you can either try elevated permissions or, preferably, change your npm install path to something your user has permissions for:

    npm config set prefix <PATH_NAME>
    

    If that doesnt work, ask yourself:

    • Does the folder specified in the error exist?
    • Did I install npm as a different user?
    • What terminal am I using? (PowerShell, WSL, cmd)

    That should give you some ideas where to go from there.

    Login or Signup to reply.
  2. create-react-app must include the app name, remove ‘./’ and mention the name of the app. Hope your error will be resolved then

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search