Last active
March 6, 2020 04:56
-
-
Save mrtuvn/ef09dec7a031b0e53c6af9eb69717d71 to your computer and use it in GitHub Desktop.
nodejs10x_installation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl -sL https://deb.nodesource.com/setup_10.x -o nodesource_setup.sh | |
sudo bash nodesource_setup.sh | |
sudo apt install nodejs | |
apt-get install gcc g++ make build-essential | |
curl -sL https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add - | |
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list | |
sudo apt-get update && sudo apt-get install yarn | |
mkdir ~/.npm-global | |
Configure npm to use the new directory path: | |
npm config set prefix '~/.npm-global' | |
In your preferred text editor, open or create a ~/.profile file and add this line: | |
export PATH=~/.npm-global/bin:$PATH | |
On the command line, update your system variables: | |
source ~/.profile | |
To test your new configuration, install a package globally without using sudo: | |
npm install -g jshint |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment