Install Node.js on Ubuntu

后端 未结 18 1021
没有蜡笔的小新
没有蜡笔的小新 2020-12-04 04:39

I\'m trying install Node.js on Ubuntu 12.10, but the terminal shows me an error about lost packages. I tried with this:

sudo apt-get install python-software-         


        
相关标签:
18条回答
  • 2020-12-04 05:10

    Now you can simply Install with:

    sudo apt-get install nodejs
    sudo apt-get install npm
    

    Make sure you have python and c preinstalled. If not perform:

    sudo apt-get install python g++ make
    
    0 讨论(0)
  • 2020-12-04 05:14

    npm is automatically installed with node.js in the latest version of node. What do you see when you type node --version and npm --version in the terminal?

    You can upgrade npm using npm itself as well

    [sudo] npm install -g npm
    
    0 讨论(0)
  • 2020-12-04 05:14
    wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.19.0/install.sh | bash    
    
    nvm install v0.10.33
    

    just use nvm for node version control nvm

    0 讨论(0)
  • 2020-12-04 05:15

    really simple:

    sudo apt install nodejs
    

    and then type:

    nodejs
    

    to use.

    0 讨论(0)
  • 2020-12-04 05:16

    Simply follow the instructions given here:

    Example install:

    sudo apt-get install python-software-properties python g++ make
    sudo add-apt-repository ppa:chris-lea/node.js
    sudo apt-get update
    sudo apt-get install nodejs
    

    It installs current stable Node on the current stable Ubuntu. Quantal (12.10) users may need to install the software-properties-common package for the add-apt-repository command to work: sudo apt-get install software-properties-common

    As of Node.js v0.10.0, the nodejs package from Chris Lea's repo includes both npm and nodejs-dev.

    Don't give sudo apt-get install nodejs npm just sudo apt-get install nodejs

    0 讨论(0)
  • 2020-12-04 05:17

    Node.js package is available in the LTS release and the current release. It’s your choice to select which version you want to install on the system as per your requirements.

    Use Current Release: At the last update of this tutorial, Node.js 13 is the current Node.js release available.

    sudo apt-get install curl
    curl -sL https://deb.nodesource.com/setup_13.x | sudo -E bash -
    

    Use LTS Release: At the last update of this tutorial, Node.js 12.x is the LTS release available.

    sudo apt-get install curl
    curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -
    

    You can successfully add Node.js PPA to the Ubuntu system. Now execute the below command install Node on and Ubuntu using apt-get. This will also install NPM with node.js. This command also installs many other dependent packages on your system.

    sudo apt-get install nodejs
    

    After installing node.js verify and check the installed version. You can find more details about the current version on node.js official website.

    node -v 
    
    v13.0.1
    

    Also, check the npm version

    npm -v 
    
    6.12.0
    
    0 讨论(0)
提交回复
热议问题