Skip to main content
Post Made Community Wiki by blackgreen
Source Link
ivsuleman
  • 364
  • 4
  • 9

I wanted to run npm install from within my external hard drive as this is where i saved my code workspace. Windows 10 OS.

But I was getting the same error as the original post.None of the previous answers worked for me, I tried all of them:

  1. uninstalling nodejs then re-installing
  2. uninstalling nodejs then downgrading/installing a lower version of nodejs.
  3. npm install -force
  4. deleting the folders from C:\Users{YourUsername}\AppData\Roaming ... npm and npm-cache then re-installing.
  5. npm cache clean --force
  6. npm cache clean
  7. npm install --g or npm install --global

What worked for me was this:

  1. copy the folder from C:\Program Files\nodejs to D:\Program Files\nodejs
  2. Then go to Control Panel\System and Security\System
  3. Advanced System Settings
  4. Environment Variables
  5. System Variables
  6. Double click Path
  7. Add a new path
  8. D:\Program Files\nodejs
  9. Click ok
  10. restart PC.
  11. try npm install from within D: Drive