Reputation: 631
I was trying to change my npm and npm-cache folders to d:\\npm-global
and d:\\npm-cache
I managed to do a npm config set cache d:\npm-cache
When I tried to do a npm config set prefix d:\npm-global
I accidentally put a ' in the folder string as I was hitting enter. I deleted the errant folder after trying a npm i -g gulp
and to my horror, npm stopped working altogether, it just sits there with my command prompt rocking up to 50% CPU usage.
Help please! I've tried searching the registry and other places, even uninstalled and re-installed the nodejs msi package on Windows. This reset the D:\Program Files\nodejs\node_modules\npm\npmrc
file.
Still no luck. I can't get npm to work again. :(
edit A little digging in and I realized there is a second node server running via Adobe Creative Cloud. I doubt this is the problem though as when I run npm
from the cmd.exe prompt, the correct (d:\program files\nodejs) version of the npm server is executed for that process.
edit so only sometimes when I hit Control-C, I'll get this error:
seems like it's trying to find a file that doesn't exist. However, I cleared out the AppData\Roaming\npm
folder and the reinstalls reset the default d:\program files\nodejs\....npm\npmrc
file. I also made sure that the environment variable NODE_PATH
is not set. It wasn't set when it was working. I set it when I was trying to make my changes.
Upvotes: 1
Views: 83
Reputation: 631
@jakemingolla was right so I marked that answer as accepted (thanks Jake), but I also asked this in the NPM forum and did a little test after I got it working. I thought this might help someone: https://npm.community/t/i-killed-my-npm-on-windows-trying-to-move-some-folders-reinstalling-nodejs-isnt-resetting-the-problem/5743/8?u=chi11ax
Upvotes: 0
Reputation: 1639
You should be able to modify your config settings manually by modifying ~/.npmrc
Upvotes: 1