DEV Community

Jey Yuu
Jey Yuu

Posted on

Laravel 8 'npm error' when running npm run dev in Windows 7

I am still one of those tech people who are still using Windows 7 as operating system. I know the support for this OS has already stopped and it's not recommendable anymore, however, I am still using it for personal use and I don't have budget yet to upgrade.

So, one of my encountered problems using Windows 7 while installing Laravel 8 is the "npm error" while running the npm run dev in my terminal. I tried all the accepted answers on Stackoverflow and other platforms but, they didn't work in my case.

What really solved my problem regarding this issue was:

  1. Uninstall my node.js

  2. Manually delete all npm and node_modules folder in my C:\Program Files (or wherever you might have installed it because 'uninstalling' sometimes won't delete data folders)

  3. Made sure I removed the file path C:\Users\ACER\AppData\Roaming\npm on my Environment Variables

  4. Downloaded this node version for my Windows 7 https://nodejs.org/download/release/v13.6.0/ then installed it freshly. Important: Don't forget to restart your computer after the installation!

Now when I rechecked my versions, they are now fine and working and won't give errors when typing these on my terminal:

$ npm -v
6.13.4

$ node -v
v13.6.0

$ npx -v
6.13.4

I know there are other answers out there, but I am posting my own steps just in case there are people who have similar problems who tried everything but still didn't work out.

Hope this helps.

If you think this solves your problem, just let me know.

UPDATE:
If above technique still doesn't solve the issue, do the following:

  1. Run CMD as administrator (you have to run cmd as administrator at least once after the node installation based on my experience)
  2. type "npm version" and you should see something like this:

Alt Text

  1. Then go to your terminal, and run this:

npm config rm proxy

npm config rm https-proxy

See pic:
Alt Text

After that, run npm install again and it should work fine.

Top comments (0)