How to install nodejs 6.x version on centos 6? - node.js

I use centos release 6.9
current nodejs version v0.10.48
I want install nodejs 6.x version
and I try
yum install -y gcc-c++ make
curl -sL https://rpm.nodesource.com/setup_6.x | sudo -E bash -
yum install nodejs
but occur error
enter image description here
how to install nodejs 6.x version on centos 6?

The easiest way is use n to switch the node version
To avoid some issue after version changed, please run this command.
npm cache clean -f
Then install n
npm i -g n
Now, use n install node version you want. (I suggest you lts one.)
n lts
here is n documentation https://github.com/tj/n

Related

Node JS - Not able to install node js version 8.9 or greater in ubuntu 16.04

I have tried various methods by which I can install the latest version of nodejs on my operating system but was unsuccessful.
In the end it always ends up installing
version v.4.2.6
When I run the commands below, it always shows an error as shared in the screenshots of my terminal.
Current release:
sudo apt-get install curl python-software-properties
curl -sL https://deb.nodesource.com/setup_11.x | sudo -E bash -
or LTS release:
sudo apt-get install curl python-software-properties
curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -
// throws error
Version:
Trying to execute node 11 script:
o/p of the above script:
Please guide me how can it be fixed. I have followed some of the other stackoverflow links but couldn't make it.
Thanks you for your help.
I recommand uninstalling your current NodeJS version and install nvm instead.
Then you can manage all node version with nvm.
Method 1:
I followed this link and it was successful:
updating nodejs on ubuntu 16.04
Method 2:
You can either skip above link and follow the below steps:
Using Node Version Manager (NVM):
Install it by following instructions here
Test your installation:
close your current terminal, open a new terminal, and run:
command -v nvm
Use it to install as many versions as u like:
nvm install 8 # Install nodejs 8
nvm install --lts # Install latest LTS (Long Term Support) version
List installed versions:
nvm ls
Use a specific version:
nvm use 8 # Use this version on this shell
Set defaults:
nvm alias default 8 # Default to nodejs 8 on this shell
nvm alias default node # always use latest available as default nodejs for all shells
If you have npm installed -
run
sudo npm cache clean -f
sudo npm install -g n
install n globally
npm i -g n
then switch to the latest stable node version using n
n stable

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

How to install nodejs 6.7.0 on Ubuntu 14

I have found some guides (for ex. Install latest nodejs version in ubuntu 14.04) how to install updated version of NodeJS, also followed the official one that says to use
curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
sudo apt-get install -y nodejs
which is the same thing as in the SO guide above.
However, the version of node I get is 6.3.1 but I want the latest 6.7.0. I have installed 6.7.0 on OSX via brew but don't know how to get it on Ubuntu. Is there any way to do it, using APT preferably?
I have done this way:-
sudo npm install n -g
sudo n 6.7.0
Alternatively for latest stable version you can do this:-
sudo n stable
And For latest version
sudo n latest

Please update your Node runtime to version >=0.12.x

Hi i'm working with ionic to build hybrid html app.
Every command i'm running i get the following warning:
******************************************************
Upgrade warning - for the CLI to run correctly,
it is highly suggested to upgrade the following:
Please update your Node runtime to version >=0.12.x
******************************************************
If you can please advise how should i update the node runtime version
This is just asking to upgrade your Node. I normally use nvm with command nvm install <version> && nvm use <version> or you can use node helper as follows:
sudo npm cache clean -f
sudo npm install -g n
sudo n stable // for stable version
sudo n 0.12.7 // for specific version like v0.12.7
// check the node version after install
node -v
To install Node.js v5.x on either Ubuntu or Debian:
# Using Ubuntu
curl -sL https://deb.nodesource.com/setup_5.x | sudo -E bash -
sudo apt-get install -y nodejs
# Using Debian, as root
curl -sL https://deb.nodesource.com/setup_5.x | bash -
apt-get install -y nodejs
It depends on how you have installed node.js to your computer. You can either go to https://nodejs.org/ and get the updated version, or you can use Node Version Manager (NVM) which allows you to control multiple node versions at once.
I would recommend using NVM, as this avoids having to install nodejs with sudo, which can lead to other problems down the line.
I use command:
sudo npm cache clean
sudo npm install -g cordova
sudo npm install -g ionic
and it works for me.

How to upgrade Node js version to 0.12.4 on Ubuntu

I want to upgrade Node JS version on Ubuntu.
I tried many commands but its version is still the older i.e v0.10.37.
I tried:
sudo npm install -g n
sudo n install 0.12.4
sudo n use 0.12.4
Also tried with nvm but non of them works for me. How can I upgrade Node Js version to 0.12.4?
Use npm in order to upgrade node
First Clean the cache and try
sudo npm cache clean -f
sudo npm install -g n
sudo n 0.12.4
Then create a symbolic link(It is needed only sometimes, first try with these three commands. If it doesnot work add this.)
It will be updated to 0.12.4 Version.
It could be enough just to install n module:
sudo npm install -g n
and then simply run:
sudo n 0.12.4
The trick is that it may not be updated in your current terminal session. So you can simply open one more tab in your terminal or just another terminal and check your nodejs version by:
node --version
That's it, output will be v0.12.4
The official doc from nodejs repository points to this : https://nodesource.com/blog/nodejs-v012-iojs-and-the-nodesource-linux-repositories#installing-node-js-v0-12
Just follow it and you'll have the 0.12.4.
Try running this in terminal:
nvm install 5.10.1
nvm use 5.10.1
The version may be change.
Cheers!
Execute following comand to upgrade nodejs to 0.12.x
Note the new setup script name for Node.js v0.12
curl -sL https://deb.nodesource.com/setup_0.12 | sudo bash -
Then install with:
sudo apt-get install -y nodejs
Just ignore warning. By executing both commands it worked for me on Ubuntu 14.04
On Ubuntu 16.04
There is no special or dedicated comand to upgrade node version. The correct way to install or upgrade node on ubuntu is:
1) download the distribution you wish from nodejs official site, move the file into a known path
2) open a terminal and run: >sudo tar -C /usr/local --strip-components 1 -xzf "known path/name_of_the_distribution_file...gz
3) test if everything is ok: open a new terminal and run node --version. It should echo the version you downloaded and installed/upgraded.

Resources