%appdata%\npm\etc\npmrc and add
cache entries to specify the locations where node puts packages.
Every time I install a new framework/dev environment I have to look where they put files. Having a roaming profile is a pain and I need to make sure it doesn’t get too crowded. Otherwise, logging in takes 30+ minutes.
The latest victim is NodeJS. This installs a lot of files for all packages in 2 directories (I found so far):
- Cache – a cache of installed modules
- Global – a place where it places all
install -gmodules and their dependencies
By default, both are in your roaming profile and you easily end up with 300Mb of small files. To move them, you need to:
- Go to
npmrcwith:123prefix=(directory with global installed packages)cache=(directory with cached packages)
- Save the file and remove the already installed modules.
- Reinstall your favourite modules.
A little experiment: If you find this post and ad below useful, please check the ad out :-)