How to install nodejs 0.12.7 - node.js

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.

Related

I have nodejs but not able to upgrade it by homebrew, what should I do?

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.

Unable to install of latest version of nodejs

I was having nodejs version 4.2.6 in my ubuntu 16.04 pc.
I tried to install n using command sudo npm install -g n, and the following errors came out.
Node.js 4 is supported but the specific version you're running has
a bug known to break npm. Please update to at least 4.7.0 to use this
version of npm. You can find the latest release of Node.js at https://nodejs.org/
I uninstalled the current nodejs and then reinstalled it .But everytime the version 4.2.6 is installed.I am not getting why the latest version is not installed.I followed this link to reinstall my nodejs
enter link description here
Do i need any others updated to have latest nodejs ?Please guide me
Here are the steps to follow:
First clear cache.
Then upgrade npm
Then install stable version if Node
sudo npm cache clean -f
sudo npm install -g n
sudo n stable
If that still didt work
Remove NodeJs and Npm
Install Node
sudo apt remove nodejs npm
curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
sudo apt-get install -y nodejs
You can install latest version of nodejs by adding local apt repo as mention in official doc,
curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -
sudo apt-get install -y nodejs
and then use n or nvm module to manage version.
Update: You should uninstall older version before installing newer version
sudo apt-get purge nodejs
sudo apt-get autoremove
you can use nvm and install severall version of node and switch on node version
this link help you
enter link description here
use NVM to manage all node versions

Reinstalling node.js is throwing error

I had node 6 before but I had to remove it to downgrade it to Node 4. But when I am trying to reinstall node 6/ install node 4, I am getting this error.
[root#vvvvvv xxxxxxx]# yum install -y nodejs
Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-manager
Package 2:nodejs-6.11.0-1nodesource.el7.centos.x86_64 already installed and latest version
Nothing to do
I used this to remove the previous version.
after this, as per another website source, I tried
sudo rm -fv /etc/yum.repos.d/nodesource*
but to no avail!!
When I am checking $node --version or $npm --version, I dont get any valid output.
To install Node.js I would recommend using your package manager (yum):
yum install -y nodejs
Once you have nodejs and npm installed successfully on your machine, I would then use a Node version manager (I personally use n, but nvm works as well) to install a specific version:
npm install -g n
Then use your Node version manager to install a specific Node version:
n 4
NOTE: This command above will install the latest version of Node.js 4 (which at this time is 4.8.3). If you need a specific version you can specify it instead of just n 4. To see all available versions you can use the n ls command
You can verify your version of Node and npm using the --version flags as you were doing before

How to install NodeJS 6.1.0 on Ubuntu 16.04

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

can't check node version by installing via node version manager

I am trying to install nodejs via NVM. I use the tutorial here (https://github.com/creationix/nvm). After running nvm install v0.10.25, I try to check current node version by running node -v, but it says The program 'nodejs' is currently not installed. You can install it by typing:
apt-get install nodejs. What's wrong with this?

Resources