How to keep up with the latest versions of Node.js in Ubuntu? PPA? Compiling?

前端 未结 6 1244
清酒与你
清酒与你 2020-12-22 15:10

Where can (can I ?) find .deb packages for the latest versions of Node.js ?

If not, and because it\'s a project that progresses very fast, what is the easiest way to

6条回答
  •  南笙
    南笙 (楼主)
    2020-12-22 15:48

    If it's the latest version of Node.js you wish to install, the easiest method is to use Node Version Manager (NVM). It's safer than upgrading the node packages in Ubuntu to unsupported versions from PPAs or 3rd party repos, which may cause conflicts or breakages in apt package management system. Compared to NVM, manual installations from tarballs are harder to maintain and upgrade. Follow these steps to install the latest node using NVM:

    Step 1: Install NVM

    Run this command in Terminal:

    wget -qO- https://raw.githubusercontent.com/creationix/nvm/master/install.sh | bash
    

    Step 2: Install node

    Once NVM installation is complete, close and reopen Terminal. Then run this command:

    nvm install node
    

    Step 3: Check node version

    Run these commands:

    node --version
    npm --version
    

    If everything went well, you'll see the latest node and npm versions as output. That's all, node is installed and ready to run!

提交回复
热议问题