-
-
Notifications
You must be signed in to change notification settings - Fork 3
Install nodejs
Asterios Raptis edited this page Dec 26, 2016
·
9 revisions
First add NodeSource PPA.
To use version Node.js v5.x:
# Using Ubuntu
curl -sL https://deb.nodesource.com/setup_5.x | sudo -E bash -
sudo apt-get install -y nodejsFor a detailed description follow this link.
They are two options for do that here is the first option.
We will change the permission to npm's default directory:
sudo chown -R $(whoami) $(npm config get prefix)/{lib/node_modules,bin,share}Note: If you get error that node_modules folder not exists you can create it.
sudo mkdir -p $(npm config get prefix)/lib/node_modules
sudo chown -R $(whoami) $(npm config get prefix)/{lib/node_modules,bin,share}Thats it. If this is not an option for you use the second option that is described in the following section.
The second option is the following.
create a directory in your home directory:
mkdir ~/.npm-globalTell npm to use the new directory:
npm config set prefix '~/.npm-global'Export the bin directory by inserting following line in your ~/.profile:
export PATH=~/.npm-global/bin:$PATHUpdate with:
source ~/.profileIf you see next time by start the shell following message:
zsh compinit: insecure directories, run compaudit for list.
Ignore insecure directories and continue [y] or abort compinit [n]? Than run following commands for fix this:
cd /usr/local/share/zsh
sudo chmod -R 755 ./site-functions