Problems installing nodejs on Ubuntu 16.10 - node.js

could someone help me to understand why it fails to find these packages?
sudo apt-get install -y nodejs
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
libuv1
The following NEW packages will be installed:
libuv1 nodejs
0 upgraded, 2 newly installed, 0 to remove and 28 not upgraded.
Need to get 3.346 kB of archives.
After this operation, 14,1 MB of additional disk space will be used.
Err:1 http://it.archive.ubuntu.com/ubuntu yakkety/universe amd64 libuv1 amd64 1.9.1-1
404 Not Found
Err:2 http://it.archive.ubuntu.com/ubuntu yakkety/universe amd64 nodejs amd64 4.2.6~dfsg-1ubuntu5
404 Not Found
E: Failed to fetch http://it.archive.ubuntu.com/ubuntu/pool/universe/libu/libuv1/libuv1_1.9.1-1_amd64.deb 404 Not Found
E: Failed to fetch http://it.archive.ubuntu.com/ubuntu/pool/universe/n/nodejs/nodejs_4.2.6~dfsg-1ubuntu5_amd64.deb 404 Not Found
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?

Try to install it like this
curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
sudo apt-get install -y nodejs

Follow the Steps to install Nodejs using terminal.. Make sure your connected to internet
cd ~
curl -sL https://deb.nodesource.com/setup_8.x -o nodesource_setup.sh
nano nodesource_setup.sh
sudo bash nodesource_setup.sh
sudo apt-get install nodejs
After Installing Check the Version...
nodejs -v
Can also check the NPM version by
npm -v
https://www.digitalocean.com/community/tutorials/how-to-install-node-js-on-ubuntu-16-04

Or another way, you can use NVM to manage NodeJS version for your machine. NVM is stand for Node Version Manager.

Related

Cannot install nodejs on ubuntu 22.04

im trying to install NodeJS LTS on my vm. But ubuntu (22.04) throws an error
Error:
root#web-server ~/server# sudo apt list nodejs
Listing... Done
nodejs/unknown 18.12.0-deb-1nodesource1 arm64
N: There is 1 additional version. Please use the '-a' switch to see it
root#web-server ~/server# sudo apt install nodejs
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following packages were automatically installed and are no longer required:
javascript-common libc-ares2 libjs-highlight.js libnode72
Use 'sudo apt autoremove' to remove them.
The following NEW packages will be installed:
nodejs
0 upgraded, 1 newly installed, 0 to remove and 93 not upgraded.
Need to get 0 B/27.8 MB of archives.
After this operation, 180 MB of additional disk space will be used.
(Reading database ... 83553 files and directories currently installed.)
Preparing to unpack .../nodejs_18.12.0-deb-1nodesource1_arm64.deb ...
Unpacking nodejs (18.12.0-deb-1nodesource1) ...
dpkg: error processing archive /var/cache/apt/archives/nodejs_18.12.0-deb-1nodesource1_arm64.deb (--unpack):
trying to overwrite '/usr/share/systemtap/tapset/node.stp', which is also in package libnode72:arm64 12.22.9~dfsg-1ubuntu3
Errors were encountered while processing:
/var/cache/apt/archives/nodejs_18.12.0-deb-1nodesource1_arm64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
root#web-server ~/server [100]#
I tried to delete and install it again multiple times bu nothing happens
Follow this link: Github Error solved link
and reinstall nodejs with the following command as given below
Installed Nodejs version-12.22.9 Successfully on my Ubuntu 22.04
sudo apt update
sudo apt install nodejs
Press Y when prompted to confirm installation. If you are prompted to restart any services, press ENTER to accept the defaults and continue. Check that the install was successful by querying node for its version number:
node -v
Output
v 12.22.9
Try this:
$ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh
$ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash
$ source ~/.bashrc
$ nvm list-remote
$ nvm install v16.14.0
$ nvm install lts/fermium
$ node -v
These steps will install nodejs v14.19.0.
There is a very helpful link to setup or update nodejs on Ubuntu 22.4
https://www.digitalocean.com/community/tutorials/how-to-install-node-js-on-ubuntu-22-04
you can visit it for more details.

Unable to install curl via apt on ubuntu 20.04

So I tried installing using apt
sudo apt update && sudo apt upgrade
sudo apt install curl
It returns done like this and then nothing happens
Reading package lists... Done
Building dependency tree
Reading state information... Done
So when checking
curl --version
nothing is returned.
Please note: Previously installed with snap but that has some issues because it couldn't install nodejs.
So removed it and trying to install from apt.
Please help.
I suggest trying to reinstall curl via apt:
sudo apt reinstall curl

Nodejs install issue on ubuntu

I install nodejs using the following command on ubuntu
curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
sudo apt-get install -y nodejs
Then it gives this message,
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 253 not upgraded.
W: Duplicate sources.list entry https://dl.bintray.com/sbt/debian/ Packages (/var/lib/apt/lists/dl.bintray.com_sbt_debian_Packages)
W: You may want to run apt-get update to correct these problems
When I do "sudo apt-get update", I get another error,
W: Failed to fetch http://ppa.launchpad.net/chris-lea/node.js/ubuntu/dists/wily/main/binary-amd64/Packages 404 Not Found
W: Failed to fetch http://ppa.launchpad.net/chris-lea/node.js/ubuntu/dists/wily/main/binary-i386/Packages 404 Not Found
W: Failed to fetch http://ppa.launchpad.net/ole.wolf/rarcrack/ubuntu/dists/wily/main/binary-amd64/Packages 404 Not Found
W: Failed to fetch http://ppa.launchpad.net/ole.wolf/rarcrack/ubuntu/dists/wily/main/binary-i386/Packages 404 Not Found
E: Some index files failed to download. They have been ignored, or old ones used instead.
Could you please let me know what how to correct that problem?
The errors occur because the four source links you (or some installer) added to your /etc/apt/sources.list are not found and return error 404.
If said entries are not in /etc/apt/sources.list, you can find them in some file /etc/apt/sources.list.d/*.list.
Delete the lines containing those urls in your /etc/apt/sources.list (or some file /etc/apt/sources.list.d/*.list) and install Node.js the official way:
https://nodejs.org/en/download/package-manager/#debian-and-ubuntu-based-linux-distributions
curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
sudo apt-get install -y nodejs
Or if you want version 6:
curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
sudo apt-get install -y nodejs
Note
Maybe your running into that problem because your Ubuntu version is not supported.
I don't think they support 15.10, but only the LTS versions (14.04 & 16.04).
If you can, upgrade to 16.04 and try again.

Installing NodeJS 4.4.7 or later on Ubuntu 16.04 server

In order to run a Meteor app created with the latest version of Meteor, I need to install Node.js 4.4.7 or greater on an Ubuntu 16.04 server. I have followed the instructions in the DigitalOcean tutorial exactly:
cd ~
curl -sL https://deb.nodesource.com/setup_6.x -o nodesource_setup.sh
sudo bash nodesource_setup.sh
However, when I execute the script, after a number of Get and Ign processes which seem to terminate without error, I get one 404 Not Found error, and then notification about Error executing command, exiting:
...
Ign:13 http://ppa.launchpad.net/chris-lea/node.js/ubuntu xenial/main Translation-en
Err:7 http://ppa.launchpad.net/chris-lea/node.js/ubuntu xenial/main amd64 Packages
404 Not Found
Ign:9 http://ppa.launchpad.net/chris-lea/node.js/ubuntu xenial/main i386 Packages
Ign:11 http://ppa.launchpad.net/chris-lea/node.js/ubuntu xenial/main all Packages
Ign:12 http://ppa.launchpad.net/chris-lea/node.js/ubuntu xenial/main Translation-en_GB
Ign:13 http://ppa.launchpad.net/chris-lea/node.js/ubuntu xenial/main Translation-en
Fetched 190 kB in 2s (74.5 kB/s)
Reading package lists... Done
W: The repository 'http://ppa.launchpad.net/chris-lea/node.js/ubuntu xenial Release' does not have a Release file.
N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
N: See apt-secure(8) manpage for repository creation and user configuration details.
E: Failed to fetch http://ppa.launchpad.net/chris-lea/node.js/ubuntu/dists/xenial/main/binary-amd64/Packages 404 Not Found
E: Some index files failed to download. They have been ignored, or old ones used instead.
Error executing command, exiting
I have been able to install NodeJS 4.2.6, using sudo apt-get install nodejs but I have been unable to update to a newer version. What am I missing?
I found that the following steps solve this issue:
sudo apt-get update
sudo apt-get install build-essential libssl-dev curl
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.31.1/install.sh | bash
Close and reopen terminal session
source ~/.profile
nvm ls-remote
nvm install v4.4.7
nvm use v4.4.7
node -v
Shows:
v4.4.7
Source:Installing using Node Version Manager (NVM)
Note: curl <url> | bash requires trust in the provider of the downloaded script.

404 on sudo apt-get update 404 not found chris-lea/node.js

I'm trying to use
$ sudo add-apt-repository ppa:chris-lea/node.js
$ sudo apt-get update
to install and update an npm and nodejs
Most of the references to this repository I've found are out of date from 2011-2013
I get a 404 error during $ sudo apt-get update to the link
http://ppa.launchpad.net/chris-lea/node.js/ubuntu/dists/wheezy/main/binary-armhf/Packages 404 Not found
Is there a more updated version of this?
https://github.com/joyent/node/wiki/Installing-Node.js-via-package-manager has instructions for a repository which supersedes the old PPA. (For me, this is the top Google hit for node-js ppa.)
curl -sL https://deb.nodesource.com/setup | sudo bash -
sudo apt-get install -y nodejs
(I don't particularly recommend running stuff you download without auditing it first, nor have I tried these instructions.)
The nodejs and npm package are included in the wheezy/main repository.
In order to install npm and nodejs on raspbian you should include in /etc/apt/sources.list
deb http://mirrordirector.raspbian.org/raspbian/ wheezy main
Next you should be able to install nodejs and npm using :
sudo apt-get update
sudo apt-get install npm nodejs
I had the same issue, I could work around it changing the source to the previous Ubuntu version.
So, from this:
http://ppa.launchpad.net/chris-lea/node.js/ubuntu vivid main
To this:
http://ppa.launchpad.net/chris-lea/node.js/ubuntu utopic main

Resources