How to install a specific version of Node on Ubuntu?

前端 未结 14 731
Happy的楠姐
Happy的楠姐 2020-12-07 12:52

I would like to install NodeJS version 0.8.18 on Ubuntu 12.04. I tried to install the newest version and then reverting to 0.8.18 by using nvm, but when I run m

14条回答
  •  醉话见心
    2020-12-07 13:25

    Here is a list of available builds for debian: https://github.com/nodesource/distributions/tree/master/deb

    For this example, lets assume you want version 14 (LTS at the time of writing)

    We can download this script from github, execute it and install the version of node we want. For security reasons it's a good idea to read the script prior to executing it.

    curl -sL https://raw.githubusercontent.com/nodesource/distributions/master/deb/setup_14.x | bash
    apt-get install -y nodejs # may or may not require sudo based on your setup 
    

    I like this approach because it doesn't require extraneous dependencies like nvm to target specific versions

    If you are building for a different distro or architecture you can find more builds here https://nodejs.org/dist/

提交回复
热议问题