Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot find NPM on AppData\Roaming

Tags:

node.js

I'm starting learning nodejs with express, when I try to run the command "npx create-react-app my-app" I get several errors that npm was not found

npm ERR! enoent This is related to npm not being able to find a file.

The logs says:

verbose stack Error: ENOENT: no such file or directory, lstat 'C:\Users\irami\AppData\Roaming\npm'

However, if I run the following

npm config get prefix

I get

C:\Users{myname}\AppData\Roaming\npm

Not quite understanding what is I'm doing wrong, or how to fix it. Any help?

like image 360
Iliana Ramirez Avatar asked Mar 13 '26 20:03

Iliana Ramirez


2 Answers

This actually worked for me:

  1. Updated npm to the latest version
npm install -g npm@latest
  1. Clean npm cache
npm cache clean -f
  1. Delete node modules and package-lock.json
npm rm -rf node_modules

rm package-lock.json
  1. Retry installing dependencies
npm install

After all those steps, I was able to see npm under AppData\Roaming. Thanks for your answers :)

like image 82
Iliana Ramirez Avatar answered Mar 15 '26 08:03

Iliana Ramirez


Create an empty npm directory in AppData directory.

Then re-run npx create-react-app my-app.

like image 40
Chris Perry Avatar answered Mar 15 '26 08:03

Chris Perry



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!