can't check node version by installing via node version manager - node.js

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?

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.

I installed Node-12 from source but can't get nodejs --version

I have a problem after installing node in Ubuntu 16. I installed node-12 from node-v12.13.1-linux-x64.tar.xz but I can't get nodejs --version to execute.
The program 'nodejs' is currently not installed. You can install it by typing
sudo apt install nodejs
What should I do ?
you can do node -v , nodejs is not the name of the executable

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

How to install nodejs 0.12.7

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.

Resources