I've installed Node.js using the command sudo apt-get install nodejs. This is installing Node version 6.5.0. But I have to work on version 6.1.0.
How can I install a specific version?
You can use nvm to install a specific version of Node.js.
After installing nvm, use this in a terminal:
nvm install 6.1.0
Then, verify that the correct version has been installed by using node -V. Using nvm, you can switch between Node versions trivially easily, which can be very helpful when you're using modules that require a specific version.
this tutorial schould help you https://www.digitalocean.com/community/tutorials/how-to-install-node-js-on-ubuntu-16-04
Edit:
got this from here https://ru.stackoverflow.com/a/521729
Related
I am on Mac 11.6 (20G165).
I have node.js v10 installed and want to upgrade to v12.
However, when I type brew upgrade node, I got this:
$brew upgrade node
Error: node not installed
I think it's because I didn't install node via homebrew before. But it's been such a long time and I couldn't remember what exact source/channel did I choose to install node long ago.
So what I can do to fix all this?
If you have NVM installed you can run:
nvm install 12.14.1
then set the default Node with:
nvm alias default v12.14.1
Validate:
node -v
As you said, the problem is with the installed version. you are not installed nodejs with homebrew previously.
So, if you want to install it with brew and use its benefits (like upgrading) try to uninstall the currently installed version with the instruction in this post.
Then, install the latest version via brew command:
brew install node
More on brew documentation.
I have two versions of node.js installed on my Ubuntu server(Ubuntu 14.04, node.js v0.12.4 and v6.9.2), the version 0.12.4 was installed through downloaded archive file and the version 6.9.2 was installed through apt-get by following this. However whenever I run npm test command for my project, it can't find version 6.9.2 node.js(which needs node version >= 6.x.x), what should I do to uninstall the obsolete version 0.12.4 node.js?
I believe nvm could be the solution. BTW, node.js LTS version is currently 6.9.1
I need to upgrade the latest version of Node.js in my Ubuntu system. Is this latest version user-friendly ? I need the command to upgrade it using Ubuntu 14.04.
I suggest you install nodejs through nvm (node version manager), this way you can have various version at one time and can easily change what version you want
https://github.com/creationix/nvm
installing latest node should just be like this
nvm install node
or to install specific version
nvm install v4.5.0
I installed NodeJs with the following commands:
brew install node
It downloaded the version 5.5.0 of NodeJs.
I want the version 4.1.2 (for Ionic compatibility).
How to download this specific one?
I can't run brew switch node 4.1.2 since I've never downloaded it before.
May I suggest using nvm instead?
With nvm you can switch between node versions really easy:
nvm install 4.2
And you can install multiple versions of node and switch between them as you wish.
You can search available versions of node to install by running:
brew search node
The closest version would be "node4-lts". To obtain that version, run:
brew install homebrew/versions/node4-lts
I've trying to install the latest version of nodejs
sudo apt-get nodejs
installs the version 0.12.25
When I downloaded the tar.gz from https://nodejs.org/ and installed
my node version upgraded to 0.12.7 but not nodejs version.
And when I tried like this
sudo apt-get install nodejs=0.12.7
E: Version '0.12.7' for 'nodejs' was not found
This error popped up. What can I do such that on entering
nodejs -v
I can get 0.12.7
Since there are a lot of Node.js versions, and there is also iojs, I suggest you to use a straightforward Node.js version manager, like the very good n.
So, first install n, then install Node.js 0.12.7 with:
$ n 0.12.7
When you install node.js from source by default it will install with node as name of the executable
node -v
Will show 0.12.7
If you need node.js for development purposes on your machine you can use nvm, it allows to install different versions of node.js and io.js, and easily switch between them
Remove node with command sudo apt-get remove node, then remove nodejs using sudo apt-get remove nodejs. After that try to install nodejs again with version you need sudo apt-get install nodejs=0.12.7.