Skip to content

Instantly share code, notes, and snippets.

@elzup
Last active February 10, 2022 15:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save elzup/e62c352fb94cb62db2590be90322aee6 to your computer and use it in GitHub Desktop.
Save elzup/e62c352fb94cb62db2590be90322aee6 to your computer and use it in GitHub Desktop.
node setup by n
# install n
sudo apt install -y nodejs npm
sudo npm install n -g
# install node by n
sudo n stable
sudo apt purge -y nodejs npm
# reload
exec $SHELL -l
node -v
# change global dir
mkdir ~/.npm-global
npm config set prefix '~/.npm-global'
echo 'export PATH=~/.npm-global/bin:$PATH' >> ~/.bashrc
exec $SHELL -l
# install yarn
npm i -g yarn
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment