2 ms·
I used to use n before I found out about nvm[1]. I used to have issues installing Node.js packages with n, but so far nvm just works. The best advantage of nvm
by cmwelsh 14y ago
I used to use n before I found out about nvm[1]. I used to have issues installing Node.js packages with n, but so far nvm just works.
The best advantage of nvm is that I can easily install global packages without being the root user, because it installs your Node.js files in a per-user ~/nvm/ folder (this is customizable to whatever folder you choose).
[1] https://github.com/creationix/nvm https://github.com/creationix/nvm
- dfc 14y ago"The best advantage of nvm is that I can easily install global packages without being the root user" One of us is very confused (it easily could be me). I do not understand this statement at all. How is something global if its in a user directory?
- cmwelsh 14y agoWhen you install a package using npm with the flag -g, it means that the package is global, i.e. available from any current working directory. The default is to only search the current directory hierarchy for a folder called "node_modules". That way every project that you work on can have its own versions of every library, instead of sharing them for the entire system. You can learn more about "global" vs "local" packages by reading the npm manual.
- deleted 14y ago[deleted]