Home >Web Front-end >Front-end Q&A >How to install nodejs with apt
How to install nodejs with apt: 1. Open the terminal window; 2. Install it through the "sudo apt-get update sudo apt-get install nodejs" command.
The operating environment of this article: Ubuntu 12.10 system, nodejs v5.10.1 version, Dell G3 computer.
How to install nodejs with apt?
apt-get installation:
This method is very simple, just two commands
sudo apt-get update sudo apt-get install nodejs
If you install it like this, you will find that nodejs The version is very low
#I read other articles on the Internet, and I need to install other packages
# apt-get update # apt-get install -y python-software-properties software-properties-common # add-apt-repository ppa:chris-lea/node.js # apt-get update # apt-get install nodejs
But I also said that it is applicable to the latest version of Ubuntu, Ubuntu I tried it on 12.04 LTS, Ubuntu 12.10, Ubuntu 13.04 and other versions
. Apparently Ubuntu 16.04 is no longer applicable.
Attachment:
Use nvm to install node
Install nvm
wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.33.6/install.sh | bash
Use of nvm
Commonly used nvm instructions include these
nvm ls: List locally installed node versions
nvm ls-remote: List all node versions
nvm install --lts: Install lts version
nvm install
: Install the specified version nvm use
: Use the specified version
For more instructions, enter nvm or nvm help directly to view
Recommended learning: "node video tutorial"
The above is the detailed content of How to install nodejs with apt. For more information, please follow other related articles on the PHP Chinese website!