notes/nodejs/nodejs.md

29 lines
907 B
Markdown
Raw Normal View History

2020-01-21 17:33:42 -05:00
version management
===================================================================================================================================
## nvm
2020-01-13 15:54:54 -05:00
can use nvm to manage nodejs versions.
not really sure how this works, but it is per user and operates off bash scripts and variables ¯\_(ツ)_/¯
2020-01-17 13:01:54 -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
2020-01-13 15:54:54 -05:00
nvm install --lts
2020-01-21 17:33:42 -05:00
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`