Issue with npm after reinstalling node.js
To fix this in Windows, create a directory junction to your users folder that didn't have a space in it. You can run a command like this in an administrative powershell:
cmd /c mklink /J "C:\Users\myname" "C:\Users\My Name"
You can then use this junction as if it were your real user directory:
npm config set cache C:\Users\myname\AppData\Roaming\npm-cache
npm config set prefix C:\Users\myname\AppData\Roaming\npm
(the above should update your user .npmrc file)
I had a similar problem a while ago. Try navigating to the file named .npmrc
, in C:\Users\%UserName%
, and deleting it.