notes/nodejs.md

37 lines
1.1 KiB
Markdown
Raw Normal View History

2020-01-22 11:12:47 -05:00
version management
===================================================================================================================================
## nvm
can use nvm to manage nodejs versions.
2020-11-11 23:29:12 -05:00
not really sure how this works, but it is per user and operates off bash scripts and variables
2020-01-22 11:12:47 -05:00
going to have to pull from github. It will curl to clone the repo and then add some stuff to your bashrc to make it work.
`exec bash` after install to refresh
nvm install --lts
nvm use version
## npm n helper
npm can be used to manage node itself through n
https://github.com/tj/n
sudo npm cache clean -f
1. setup & *own* directyory with versions
* `sudo mkdir -p /usr/local/n`
* `sudo chown -R $(whoami) /usr/local/n`
2. own the instalation folders
* `sudo chown -R $(whoami) /usr/local/bin /usr/local/lib /usr/local/include /usr/local/share`
3. install n: `sudo npm install -g n`
2020-01-31 17:04:11 -05:00
## upgrading npm in windows
`npm install -g npm-windows-upgrade`
or just download from the wesite
2020-11-11 23:29:12 -05:00
## npm
to update npm do `npm install npm@latest -g`