Home  >  Article  >  Web Front-end  >  How to install nodejs with apt

How to install nodejs with apt

藏色散人
藏色散人Original
2021-11-19 14:08:295195browse

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.

How to install nodejs with apt

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

How to install nodejs with apt

#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.

How to install nodejs with apt

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn