how can i switch my node version to the newer one (v14.15.4) ? I have tried all solutions here from stackoverflow... but no success.
I have made the following steps:
npm cache clean -f
npm install -g n
n stable
I ask for support.
RalfsMacBookPro:~ ralfborde$ sudo n stable
installed : v14.15.4 to /usr/local/bin/node
active : v10.23.2 at /usr/local/opt/node#10/bin/node
my current version:
RalfsMacBookPro:~ ralfborde$ node -v
v10.23.2
Try this for version-management:
sudo npm install n -g
Then try this to upgrade it
sudo n stable
OR
sudo n latest
Related
Ubuntu 20.04.3 LTS
Version 14.0.0 is installed, node -v always shows it. Although in the list of programs Node appears as 16.13.1. I can manually change the version via nvm, but this is very inconvenient. How to make sure that there is no ghost on my computer about version 14?
You can use n module from npm in order to upgrade node
sudo npm cache clean -f
sudo npm install -g n
sudo n stable
to update to the latest version use
sudo n latest
Explained
I solved this problem
rm -rf ~/.nvm
nvm install 16
I tried various options available over the internet as listed below, but still node v8 is there even though I restarted my system as well-
sudo npm install n -g
sudo n stable
npm install -g n
sudo npm cache clean -f sudo npm install -g n sudo n stable
brew update brew upgrade brew upgrade node
brew update && brew upgrade node && npm update -g npm
sudo npm cache clean -f sudo npm install -g n
sudo rm -rf /opt/local/bin/node /opt/local/include/node
/opt/local/lib/node_modules sudo rm -rf /usr/local/bin/npm
/usr/local/share/man/man1/node.1 /usr/local/lib/dtrace/node.d
brew uninstall --force node brew unlink node brew install node#10
use NVM to switch node versions, you can use the install script directly, restart the shell and start using it like:
nvm install <node_version>
if you want to get the list of available versions you can:
nvm ls-remote
if you want to see what versions has already been installed:
nvm ls
to switch a version is:
nvm use <node_version> # the version should be already installed using nvm install
and to set up a default version you can alias it like this:
nvm alias default
Hope it helps.
Mac OS with nvm installed. I was trying to change node from 10 to 12.
In my case, nvm use *.* didn't work.
It used to work once with nvm use 10, but later when I needed to switch to Node 12, nvm use 12 didn't work for me like other attempts to change.
So the steps that helped:
which -a node showed me that I have multiple paths to the node:
``
/usr/local/opt/node#10/bin
/Users/username/.nvm/versions/node/v12.22.7/bin/node
/opt/local/bin/node
/usr/local/bin/node
I have commented out (removed) the line with the unwanted path /usr/local/opt/node#10/bin in the files:
~/.bash_profile
~/.zshrc
Step 2 unfrozen the nvm use [version] command on my Mac.
Maybe it help someone.
how can I solve the following error? I use Ubuntu 16.
When I run any npm command such as "npm run dev" I get this error:
ERROR: npm is known not to run on Node.js v4.2.6 Node.js 4 is
supported but the specific version you're running has a bug known to
break npm. Please update to at least ${rel.min} to use this version of
npm. You can find the latest release of Node.js at https://nodejs.org/
First, Uninstall completely nodejs and npm.
sudo apt remove nodejs npm
Then, reinstall it over the link below:
curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
sudo apt-get install -y nodejs
Refer: https://nodejs.org/en/download/package-manager/#debian-and-ubuntu-based-linux-distributions
You can try downgrading the node version to switch from the bugged version using the following, upgrading also works if your app supports latest versions.
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.4/install.sh | bash
nvm install 4.2.5
nvm use 4.2.5
//check with
node -v
//To uninstall a node version
nvm uninstall 4.2.6
I just had this issue on Ubuntu 16. Use n to update to the latest version
sudo n latest
That should settle it.
I download latest install package from https://nodejs.org/en/ and reinstall it. Solve it!
You can also use NVM - I did this to solve the same problem.
first type
nvm ls-remote to view the latest versions available,
then
nvm install [version] (I used v8.7.0)
everything should be fine after that.
I had a similar problem but my project is part of a bigger system so neither switching to nvm instead of npm nor upgrading my version of Node.js were options.
However, moving npm backwards to a previous version was an option. I found 4.6.1 worked without complaint.
sudo npm install -g npm#4.6.1
This version of npm did not complain.
I fixed the same issue with Ubuntu 16.04 by using following commands step by step.
Uninstall nodejs and install version 8.0
$ sudo apt remove nodejs npm
$ curl -o-
https://raw.githubusercontent.com/creationix/nvm/v0.33.2/install.sh | bash
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh"
$ nvm install 8.0
$ nvm use 8.0
$ node -v
v8.0.0
Get latest release with
$ nvm install node
Then run the following
$ nvm alias default stable_node_version
I currently have node.js version v7.6.0
According to documentation, v8.5.0 is the latest version of node.
I have tried installing it using https://nodejs.org/en/
node -v returns v7.6.0.
I have tried the following commands in Terminal:
[sudo] npm install npm#latest -g
npm install npm#latest -g
sudo apt-get update
sudo n 0.8.21
sudo n latest
lsb_release -a
Each command appears to recognize and install the latest version, but the final message reads:
Installed: v7.6.0
I've altered my BASH Profile to include:
/usr/local/bin/node
/usr/local/bin/npm
My version still shows v7.6.0 as the current version running.
Side Note:
My NPM is up-to-date at version 5.4.2
Is there any other way to update my Node to the current version?
In order to update to the latest version of node, use commands:
nvm use system
nvm run system --version
nvm install node
These commands will bring you to the latest version of node.
Thank you!
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.