nodejs latest version on my pc is not the latest - node.js

i was going to start use reactjs when but i had this :
create-react-app myapp
You are running Node 9.11.2.
Create React App requires Node 14 or higher.
Please update your version of Node.
i tried to update my node js by runing :
sudo apt-get install -y nodejs
Reading package lists... Done
Building dependency tree
Reading state information... Done
nodejs is already the newest version (8.10.0~dfsg-2ubuntu0.4).
The following package was automatically installed and is no longer required:
libllvm6.0
Use 'sudo apt autoremove' to remove it.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
My pc is 32 bit extensa 5635z
my os is lubuntu
any help please ?

To install the desired version of nodejs you can use the NodeSource Node.js Binary Distributions.
For Node.js v17.x:
# Using Ubuntu
curl -fsSL https://deb.nodesource.com/setup_17.x | sudo -E bash -
sudo apt-get install -y nodejs

Related

Command 'nodejs' not found, but can be installed with: sudo apt install nodejs in ububtu

installed node.js already but shows
Command nodejs not found, but can be installed with:
sudo apt install nodejs
then tried, sudo apt install nodejs
and shows
Reading package lists... Done
Building dependency tree
Reading state information... Done
nodejs is already the newest version (14.13.1-deb-1nodesource1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
but when I try to check node.js version, $ nodejs -v
it shows, Command nodejs not found, but can be installed with:
sudo apt install nodejs
Please help me to solve this error and properly see node.js version
The nodejs executable is called node, please run node --version to see if your installation works.

NodeJS is already installed but won't run

I'm running Ubuntu 18 on my VPS server, and I'm trying to run NodeJS, however, this happens:
seth#vps186104:~$ nodejs -v
Command 'nodejs' not found, but can be installed with:
sudo apt install nodejs
seth#vps186104:~$ sudo apt install nodejs
Reading package lists... Done
Building dependency tree
Reading state information... Done
nodejs is already the newest version (8.10.0~dfsg-2).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
seth#vps186104:~$
It says to install the package to run nodejs, however, trying to install nodejs it says it's already installed
What is going on?
Try running:
curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
sudo apt-get install -y nodejs
Or if you want node 10.
curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -
sudo apt-get install -y nodejs

Node not installed after installation

I installed nodejs using sudo apt-get, which appeared to continue perfectly.
If I now run sudo apt-get install nodejs it'll tell me:
Reading package lists... Done
Building dependency tree
Reading state information... Done
nodejs is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 113 not upgraded.
Yet, when I try to test node using node -v or node hello.js there is no reply. No error nothing.
How can I get it running?
Remove current nodejs package
sudo apt-get purge nodejs
and run the following command (node version 10)
curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -
sudo apt update
sudo apt-get install -y nodejs
then check again
node -v

Unable to install node on Ubuntu 16.04

I moved from windows to ubuntu and following the instruction as per the site - https://nodejs.org/en/download/package-manager/#debian-and-ubuntu-based-linux-distributions
Following comand ran successfully
curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
Then
sudo apt-get install -y nodejs
The output of the above command is :
$sudo apt-get install -y nodejs
Reading package lists... Done
Building dependency tree
Reading state information... Done
nodejs is already the newest version (4.2.6~dfsg-1ubuntu4.1).
0 upgraded, 0 newly installed, 0 to remove and 519 not upgraded.
As you can see its taking nodejs of version 4 , although I trying to install 8+
I removed the nodejs with
sudo apt-get remove nodejs
but still on trying again it says the same thing.
Please note that the setup is new and there was nothing installed previously
I am not sure but I wanted 'node', why its trying to install nodejs
If I try to do this -
$ sudo apt-get install node
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package node is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package 'node' has no installation candidate
Hey I use Ubuntu 16 the latest LTS
What you can do, is install ubuntu-make
Then run
umake nodejs
It installs the latest version available (v8.2.1)
Or, you can also use nvm
The detailed instructions are here
Note If you use ubuntu-make , you may have to log out and log in
Then check your version via node -v
Once you have version 4, you can update it to the latest. See this topic Upgrading Node.js to latest version

Installing NodeJS on Ubuntu 16.04 Server with the Package manager installs only the distro version (v.4) instead of LTS

I have this odd problem that when I try to install NodeJS on a fresh Ubuntu Server VM.
I execute the two simple steps from the official instruction but somehow I manage to fail.
In the home directory of my user I execute curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash - which ends successfully and then sudo apt-get install -y nodejs but this results in the installation of v.4.2.6.
Output can be seen below:
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
nodejs
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/3161 kB of archives.
After this operation, 13,2 MB of additional disk space will be used.
Selecting previously unselected package nodejs.
(Reading database ... 97187 files and directories currently installed.)
Preparing to unpack .../nodejs_4.2.6~dfsg-1ubuntu4.1_amd64.deb ...
Unpacking nodejs (4.2.6~dfsg-1ubuntu4.1) ...
Processing triggers for man-db (2.7.5-1) ...
Setting up nodejs (4.2.6~dfsg-1ubuntu4.1) ...
update-alternatives: using /usr/bin/nodejs to provide /usr/bin/js (js) in auto mode
Please help.
You probably have to run sudo apt-get update before sudo apt-get install to update the local package lists after adding the sources for 6.x. If you do that, you should see version 6 being installed.
The answer was hiding in this thread: Installing NodeJS on Ubuntu Trusty
So it must have been some kind of an issue with curl using the local network so I used wget to download like this:
wget https://deb.nodesource.com/setup_6.x
And then from the same directory:
sudo bash ./setup_6.x
And finally:
sudo apt-get install nodejs
Which did it.
You might consider using nvm to install Node instead of the distro package. This offers you more flexibility in managing your version of Node.

Resources