Downgrade Node on MacBook - javascript

I installed the latest version of Node on their website, but I had issues with png and segmentation errors and such, looked it up and saw that it is a common issue on version 16. So I decided to downgrade to the stable version (14), which I have been unable to do. I've tried
npm install -g node#14.17.1
After running this and doing node -v, it still shows the latest version (16). How can I uninstall version 16 and only be on the stable version (14)?

The best way is to use nvm Here, you can get brief details on how to use nvm. nvm is a version manager for node.js, designed to be installed per-user, and invoked per-shell. nvm works on any POSIX-compliant shell (sh, dash, ksh, zsh, bash), in particular on these platforms: Unix, macOS, and windows WSL.
The best thing is, you can run multiple versions of node at the same time on a different shell, It's like version manager on steroids. Please check this also n package.

Find out where is the current node and delete
where node
Install nvm
For macOS
Show all the versions
nvm ls available
Install what you want
nvm install 14.17.1
nvm use 14.17.1
Check node version
node -v

Related

Node version v17.3.0, but environment set up for node 12.18.2. How change environment to 17.3.0?

I updated node to v17.3.0. When I type in cmd ----> node -v. I have version v17.3.0. I am trying to install react-create-app and can't. I have the message Your environment has been set up for using Node.js 12.18.2 (x64) and npm. How to solve this problem?
I suggest installing and using nvm - https://github.com/nvm-sh/nvm
Once you install it, you can do nvm install 17.3.0 and then nvm use 17.3.0
This script makes it really easy to switch between node & npm versions.

How to install latest STABLE version of a Javascript package via a package manager?

How to install latest stable version of a Javascript package via a package manager?
(no alphas, betas, etc.)
I tried NPM and did not find a solution. This question is similar.
I tried Bower and find nothing. Here is a question with no answer here.
Please help. Which package manager should I choose? Maybe there are another options around?
PS
For example: knockout.js, npm givers beta for latest. I don't want beta! I also would like to set the same limitation for dependencies - pull only stable versions.
Installing a package without specifying a version will always install the latest version published to npm, including pre-releases (alpha, beta etc.):
npm install knockout
However, if you specify the version range, even only as a wildcard *, pre-release versions are explicitly excluded:
npm install knockout#*
See the npm docs for more info. Also, you can test this in npm's semver calculator.

node 8.4.0 already installed - But node -v shows v7.7.4

I tried to upgrade my Node version, I downloaded the file from their website, run through the installation and everything seemed OK.
When I tried to check if the latest version has been installed, node -v showed me v7.7.4 instead of v8.4.0.
I tried brew upgrade node but it told me node 8.4.0 is already installed.
How do I switch to the latest version?
Thanks!
You're using nvm to install multiple versions of Node.js, and it looks like you set 7.7.4 as the default version of Node that nvm should use, which means that even though the system-wide version of Node is 8.4.0, nvm will insert the path to the 7.7.4 executable earlier in $PATH.
You can change the default to point to the system-wide version:
nvm alias default system
FWIW, Homebrew (brew) is yet another method of installing Node. However, given the amount of issues I see being posted here on StackOverflow related to that particular install, I wouldn't advise using it. Use the official installer to install the system-wide Node, and use nvm to manage different versions (for instance, to test your code with).
you can check your installation directory
Command : 'where node '

Node installed but node cannot be found in Ubuntu VPS

I installed node via NVM. I installed node 0.10.32. using NVM 0.25.0
When I do node -v I get
-bash: /root/.nvm/v0.10.32/bin/node: No such file or directory
when I do npm v I get
/root/.nvm/v0.10.32/bin/npm: 2: exec: /root/.nvm/v0.10.32/bin/node: not found
All those directories exist and node executable is in it but they are reading as not found. Node seems to be installed but I am unable to use it. I am not sure how to fix this issue. Any ideas will be greatly appreciated
Check that your ~/.bash_profile has this:
export NVM_DIR=~/.nvm
source ~/.nvm/nvm.sh
https://github.com/creationix/nvm/issues/576
A lot of things can be wrong here from what you describe. Generally I don't recommend using nvm to install Node on servers. It works fine for your own work on a local machine but when you need to be sure what is installed and where, I recommend doing a real installation.
I recently wrote a tutorial on how to install Node on Linux:
https://gist.github.com/rsp/edf756a05b10f25ee305cc98a161876a
It is specifically about version 6.7.0 but just change the version number to use any other version of Node.
You can see other answers showing how to install Node properly and troubleshoot if it isn't installed correctly:
Run npm as superuser, it isn't a good idea?
node 5.5.0 already installed but node -v fetches with "v4.2.1" on OS X & homebrew?
Just get the binary or source package of the version that you need, install it where you want and it will work. The most reliable way is to install a source package because you can run make test before you install and because npm will have the correct shebang line (which may not always be the case with binary distribution - which, incidentally, is also used by nvm). No need to use nvm or any other tool to do that.
The nvm is great if you need to quickly switch Node versions during development on your local machine but if you want a reliable way to install Node on the server then it's best to install it normally.

Can't upgrade beyond node version 0.10.35

I recently got an email from MongoDB to update my drivers to be compatible with the new MongoDB 3.0
I am trying to up my Node.js to version "1.4.29". Currently I am the running the node version "0.10.35".
How can I upgrade node.js driver via NPM to 1.4.29 to be compatible with MongoDB 3.0?
I have tried the following:
npm install g -n
I also tried this:
It just won't install any version higher then 0.10.35, Its stuck at the version. In the image above you can see it starts of my install node version 4.0 but ends up with 0.10.35 which I already have.
Which I was told would get the latest version of node but that did not seem to work.
Thanks in advance.
First you need to clean the cache and then start the up gradation process. Use the below commands in the NodeJS command window to upgrade to latest version.
npm cache clean
npm update -g
If you desire to install specific version of node then use the command sudo n 0.12.2
Reference taken from How to upgrade Node.js via NPM
The way to install the new versions of node with n is to use this command n <version>. For example use n 5.1.0 for the latest version of nodejs.

Categories

Resources