After executing below command in vs code
PS C:UsersDharavath SumanOneDriveDesktopreact> npx create-react-app my-app
npm ERR! code ENOENT
npm ERR! syscall lstat
npm ERR! path C:UsersDharavath SumanAppDataRoamingnpm
npm ERR! errno -4058
npm ERR! enoent ENOENT: no such file or directory, lstat ‘C:UsersDharavath SumanAppDataRoamingnpm’
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:UsersDharavath SumanAppDataLocalnpm-cache_logs2024-02-17T19_30_10_241Z-debug-0.log
i tried the command npx create-react-app my-app but it showed the errors as mentioned
2
Answers
Looks NPM not installed on your machine, please check the NPM and node in your machine
use below command in terminal of VSCode
The core issue: npm is unable to find the directory
Potential causes:
Solution:
Open a command prompt or terminal and type
npm config get prefix
.C:UsersDharavath SumanAppDataRoamingnpm
), update the path using:npm config set prefix C:UsersDharavath SumanAppDataRoamingnpm
Check File Permissions:
Right-click the npm directory, go to "Properties" -> "Security" and ensure your user account has "Full control" permissions.
Reinstall npm (if necessary):
If the issue persists, consider reinstalling npm: