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 my code apparently there is some problem with the packages installed and the two versions (latest and 0.8.18). Since I don't know how to solve that problem, I cleaned the machine from the Node installation and thought about installing directly the version I'm interested in (v0.8.18).
相关问题
- npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fs
- google-drive can't get push notifications
- How to reimport module with ES6 import
- Is there a way to remove IDV Tags from an AIFF fil
- Why is `node.js` dying when called from inside pyt
相关文章
- node连接远程oracle报错
- How can make folder with Firebase Cloud Functions
- @angular-cli install fails with deprecated request
- node.js modify file data stream?
- How to resolve hostname to an ip address in node j
- Transactionally writing files in Node.js
- Log to node console or debug during webpack build
- Get file created date in node
NVM (Node Version manager)
Tested in Ubuntu 17.10:
For the particular case of the most recent long term support version (recommended if you can choose):
Since the sourcing has to be done for every new shell, you will probably want to add the following to your
.bashrc
:Advantages:
allows you to use multiple versions of Node and without sudo
is analogous to Ruby RVM and Python Virtualenv, widely considered best practice in Ruby and Python communities
downloads a pre-compiled binary where possible, and if not it downloads the source and compiles one for you
yes, its a duplicate answer but I insist using n module to install a specific version(following commands installs node version 6.9.5).
FYI, according to this page in the wiki of the nodejs github repo, Chris Lea's PPA (mentioned in several other answers) has been superseded by the NodeSource distributions as the main way of installing nodejs from source in Ubuntu:
This is supported for the three latest (at the time of writing this) LTS versions of Ubuntu: 10.04 (lucid), 12.04 LTS (precise) and 14.04 (trusty).
I'm not sure this will help in installing an old version of nodejs, but I'm putting this here in case it helps others who needed to install a specific (newer) version of nodejs that isn't included in their distro's repositories.
Chris Lea has 0.8.23 in his ppa repo.
This package let you add a repository to apt-get: (You can also do this manually)
Add Chris Lea's repository:
Update apt-get:
Install Node.js:
I think (feel free to edit) the version number is optional if you only add node.js-legacy. If you add both legacy and ppa/chris-lea/node.js you most likely need to add the version.
FYI the available version for raring in Chris Lea's repo is currently 0.8.25
sudo apt-get install nodejs=0.8.25-2chl1~raring1
Install nvm using the following commands in the same order.nvm stands for node version manager.
In case the above command does not work add -k after -o- .It should be as below:
Then
nvm ls-remote
to see the available versions. In case you get N/A in return,run the following.alternatively you can run the following commands too
Then
nvm install #.#.#
replacing # by version(say nvm 8.9.4) finallynvm use #.#.#