skip to Main Content

I want to create a frontend project using

npx create-react-app frontend

encountered an error saying

npm ERR! code ENOENT
npm ERR! syscall lstat
npm ERR! path C:UsersuserAppDataRoamingnpm
npm ERR! errno -4058
npm ERR! enoent ENOENT: no such file or directory, lstat ‘C:UsersuserAppDataRoamingnpm’
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:UsersuserAppDataLocalnpm-cache_logs2024-03-06T09_13_21_921Z-debug-0.log

Tried browsing for answers but in browsing hell already.
I tried using Vite which is much easier but the folder structure of what I’m watching in YouTube is different so I get more confused.

2

Answers


  1. Chosen as BEST ANSWER

    Weird, but I fix it by running

    'npm install -g npm@latest'

    In terminal


  2. This error occurs because there isn’t ‘npm’ folder in ‘C:UsersuserAppDataRoaming’ Folder in your computer.
    I guess you change your computer name recently. Am I right?
    To fix this error, you should copy ‘npm’ folder in ‘C:UsersuserAppDataRoaming’ Folder in your computer from others…
    And then try again…

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