Reputation: 14084
I accidentally changed the npm prefix to a place that doesn't exist. Is there a configuration file I can access that would allow me to change this back?
The only options I can think of are:
But it seems like there should be a config file I can change somewhere, right?
Upvotes: 8
Views: 21488
Reputation: 11
Using this command you can set new prefix
npm config set prefix "C:\Users\{yourname}\AppData\Roaming\npm" --loglevel=verbose
Upvotes: 0
Reputation: 191809
prefix
can be defined per-install and other commands using --prefix
, but as a global setting it is in ~/.npmrc
(C:\Users\<your user name>\.npmrc
). You can remove / edit it directly in that file.
You can also use npm config set prefix $value
, or npm config delete prefix
if you prefer.
Upvotes: 10