ubuntu 16.04
I want to install npm 5.4.2 node 8.7.0.
i.e when I do npm --version it should say 5.4.2 and doing node --version should say 8.7.0.
Step1:
sudo apt install nodejs npm
sudo npm cache clean -f
sudo npm install -g n
sudo n stable
Step 2:
(setup) vivek@vivek:~/PROJECT$ sudo npm install -g n
/usr/local/bin/n -> /usr/local/lib/node_modules/n/bin/n
+ n@2.1.8
updated 1 package in 1.045s
(setup) vivek@vivek:~/PROJECT$ sudo n stable
install : node-v9.0.0
mkdir : /usr/local/n/versions/node/9.0.0
fetch : https://nodejs.org/dist/v9.0.0/node-v9.0.0-linux-x64.tar.gz
######################################################################## 100.0%
installed : v9.0.0
Step 3:
(setup) vivek@vivek:~/PROJECT$ npm --version
3.5.2
(setup) vivek@vivek:~/PROJECT$ sudo apt-get install npm
Reading package lists... Done
Building dependency tree
Reading state information... Done
npm is already the newest version (3.5.2-0ubuntu4).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Q.1 Why does it install 3.5.2 say it is the latest version ,when the current version is ~ 5.x.x or so.
Q.2 Why does it install node v9.0.0 when it is clearly not compatible with npm current releases.
(https://github.com/npm/npm/issues/19019)
So far the workaround I found was to do :
# Complete Un-install
sudo apt-get purge nodejs npm
sudo apt-get autoremove
sudo apt-get update
# Fresh install
sudo npm install -g npm
(setup) vivek@vivek:~/PROJECT$ npm --version
5.5.1
Running the same set of commands above in Step 1 & 2, all other teammates get the versions npm 5.4.2 and node 8.7.0 installed by default, but not for me. This is driving me mad. Because the wrong versions are being installed, and on top of that they are not compatible.
Update: trying 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
failed with :
curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
[sudo] password for vivek:
## Installing the NodeSource Node.js v8.x repo...
## Populating apt-get cache...
+ apt-get update
Get:1 file:/var/cuda-repo-8-0-local-ga2 InRelease
Ign:1 file:/var/cuda-repo-8-0-local-ga2 InRelease
Get:2 file:/var/cuda-repo-8-0-local-ga2 Release [574 B]
Get:2 file:/var/cuda-repo-8-0-local-ga2 Release [574 B]
Hit:4 http://us.archive.ubuntu.com/ubuntu xenial InRelease
Ign:5 http://dl.google.com/linux/chrome/deb stable InRelease
Get:6 http://us.archive.ubuntu.com/ubuntu xenial-updates InRelease [102 kB]
Hit:7 http://dl.google.com/linux/chrome/deb stable Release
Get:8 http://security.ubuntu.com/ubuntu xenial-security InRelease [102 kB]
Hit:9 http://ppa.launchpad.net/fkrull/deadsnakes/ubuntu xenial InRelease
Get:11 http://us.archive.ubuntu.com/ubuntu xenial-backports InRelease [102 kB]
Hit:12 https://download.docker.com/linux/ubuntu xenial InRelease
Get:13 http://us.archive.ubuntu.com/ubuntu xenial-updates/main amd64 Packages [653 kB]
Get:14 http://us.archive.ubuntu.com/ubuntu xenial-updates/main i386 Packages [618 kB]
Get:15 http://us.archive.ubuntu.com/ubuntu xenial-updates/main Translation-en [274 kB]
Get:16 http://us.archive.ubuntu.com/ubuntu xenial-updates/main amd64 DEP-11 Metadata [307 kB]
Get:17 http://us.archive.ubuntu.com/ubuntu xenial-updates/main DEP-11 64x64 Icons [216 kB]
Get:18 http://us.archive.ubuntu.com/ubuntu xenial-updates/restricted amd64 Packages [8,076 B]
Get:19 http://us.archive.ubuntu.com/ubuntu xenial-updates/restricted i386 Packages [8,068 B]
Get:20 http://us.archive.ubuntu.com/ubuntu xenial-updates/universe amd64 Packages [544 kB]
Get:21 http://us.archive.ubuntu.com/ubuntu xenial-updates/universe i386 Packages [517 kB]
Get:22 http://security.ubuntu.com/ubuntu xenial-security/main amd64 DEP-11 Metadata [60.2 kB]
Get:23 http://us.archive.ubuntu.com/ubuntu xenial-updates/universe Translation-en [221 kB]
Get:24 http://us.archive.ubuntu.com/ubuntu xenial-updates/universe amd64 DEP-11 Metadata [174 kB]
Get:25 http://us.archive.ubuntu.com/ubuntu xenial-updates/universe DEP-11 64x64 Icons [245 kB]
Get:26 http://us.archive.ubuntu.com/ubuntu xenial-updates/multiverse amd64 Packages [16.2 kB]
Get:27 http://us.archive.ubuntu.com/ubuntu xenial-updates/multiverse i386 Packages [15.3 kB]
Get:28 http://us.archive.ubuntu.com/ubuntu xenial-updates/multiverse amd64 DEP-11 Metadata [5,888 B]
Get:29 http://us.archive.ubuntu.com/ubuntu xenial-backports/main amd64 DEP-11 Metadata [3,328 B]
Get:30 http://us.archive.ubuntu.com/ubuntu xenial-backports/universe amd64 DEP-11 Metadata [4,588 B]
Get:31 http://security.ubuntu.com/ubuntu xenial-security/main DEP-11 64x64 Icons [62.1 kB]
Get:32 http://security.ubuntu.com/ubuntu xenial-security/universe amd64 DEP-11 Metadata [51.4 kB]
Get:33 http://security.ubuntu.com/ubuntu xenial-security/universe DEP-11 64x64 Icons [85.1 kB]
Ign:34 http://ppa.launchpad.net/pinta-maintainers/pinta-stable/ubuntu xenial InRelease
Ign:35 http://ppa.launchpad.net/pinta-maintainers/pinta-stable/ubuntu xenial Release
Ign:36 http://ppa.launchpad.net/pinta-maintainers/pinta-stable/ubuntu xenial/main amd64 Packages
Ign:37 http://ppa.launchpad.net/pinta-maintainers/pinta-stable/ubuntu xenial/main i386 Packages
Ign:38 http://ppa.launchpad.net/pinta-maintainers/pinta-stable/ubuntu xenial/main all Packages
Ign:39 http://ppa.launchpad.net/pinta-maintainers/pinta-stable/ubuntu xenial/main Translation-en_US
Ign:40 http://ppa.launchpad.net/pinta-maintainers/pinta-stable/ubuntu xenial/main Translation-en
Ign:41 http://ppa.launchpad.net/pinta-maintainers/pinta-stable/ubuntu xenial/main amd64 DEP-11 Metadata
Ign:42 http://ppa.launchpad.net/pinta-maintainers/pinta-stable/ubuntu xenial/main DEP-11 64x64 Icons
Ign:36 http://ppa.launchpad.net/pinta-maintainers/pinta-stable/ubuntu xenial/main amd64 Packages
Ign:37 http://ppa.launchpad.net/pinta-maintainers/pinta-stable/ubuntu xenial/main i386 Packages
Ign:38 http://ppa.launchpad.net/pinta-maintainers/pinta-stable/ubuntu xenial/main all Packages
Ign:39 http://ppa.launchpad.net/pinta-maintainers/pinta-stable/ubuntu xenial/main Translation-en_US
Ign:40 http://ppa.launchpad.net/pinta-maintainers/pinta-stable/ubuntu xenial/main Translation-en
Ign:41 http://ppa.launchpad.net/pinta-maintainers/pinta-stable/ubuntu xenial/main amd64 DEP-11 Metadata
Ign:42 http://ppa.launchpad.net/pinta-maintainers/pinta-stable/ubuntu xenial/main DEP-11 64x64 Icons
Ign:36 http://ppa.launchpad.net/pinta-maintainers/pinta-stable/ubuntu xenial/main amd64 Packages
Ign:37 http://ppa.launchpad.net/pinta-maintainers/pinta-stable/ubuntu xenial/main i386 Packages
Ign:38 http://ppa.launchpad.net/pinta-maintainers/pinta-stable/ubuntu xenial/main all Packages
Ign:39 http://ppa.launchpad.net/pinta-maintainers/pinta-stable/ubuntu xenial/main Translation-en_US
Ign:40 http://ppa.launchpad.net/pinta-maintainers/pinta-stable/ubuntu xenial/main Translation-en
Ign:41 http://ppa.launchpad.net/pinta-maintainers/pinta-stable/ubuntu xenial/main amd64 DEP-11 Metadata
Ign:42 http://ppa.launchpad.net/pinta-maintainers/pinta-stable/ubuntu xenial/main DEP-11 64x64 Icons
Ign:36 http://ppa.launchpad.net/pinta-maintainers/pinta-stable/ubuntu xenial/main amd64 Packages
Ign:37 http://ppa.launchpad.net/pinta-maintainers/pinta-stable/ubuntu xenial/main i386 Packages
Ign:38 http://ppa.launchpad.net/pinta-maintainers/pinta-stable/ubuntu xenial/main all Packages
Ign:39 http://ppa.launchpad.net/pinta-maintainers/pinta-stable/ubuntu xenial/main Translation-en_US
Ign:40 http://ppa.launchpad.net/pinta-maintainers/pinta-stable/ubuntu xenial/main Translation-en
Ign:41 http://ppa.launchpad.net/pinta-maintainers/pinta-stable/ubuntu xenial/main amd64 DEP-11 Metadata
Ign:42 http://ppa.launchpad.net/pinta-maintainers/pinta-stable/ubuntu xenial/main DEP-11 64x64 Icons
Ign:36 http://ppa.launchpad.net/pinta-maintainers/pinta-stable/ubuntu xenial/main amd64 Packages
Ign:37 http://ppa.launchpad.net/pinta-maintainers/pinta-stable/ubuntu xenial/main i386 Packages
Ign:38 http://ppa.launchpad.net/pinta-maintainers/pinta-stable/ubuntu xenial/main all Packages
Ign:39 http://ppa.launchpad.net/pinta-maintainers/pinta-stable/ubuntu xenial/main Translation-en_US
Ign:40 http://ppa.launchpad.net/pinta-maintainers/pinta-stable/ubuntu xenial/main Translation-en
Ign:41 http://ppa.launchpad.net/pinta-maintainers/pinta-stable/ubuntu xenial/main amd64 DEP-11 Metadata
Ign:42 http://ppa.launchpad.net/pinta-maintainers/pinta-stable/ubuntu xenial/main DEP-11 64x64 Icons
Err:36 http://ppa.launchpad.net/pinta-maintainers/pinta-stable/ubuntu xenial/main amd64 Packages
404 Not Found
Ign:37 http://ppa.launchpad.net/pinta-maintainers/pinta-stable/ubuntu xenial/main i386 Packages
Ign:38 http://ppa.launchpad.net/pinta-maintainers/pinta-stable/ubuntu xenial/main all Packages
Ign:39 http://ppa.launchpad.net/pinta-maintainers/pinta-stable/ubuntu xenial/main Translation-en_US
Ign:40 http://ppa.launchpad.net/pinta-maintainers/pinta-stable/ubuntu xenial/main Translation-en
Ign:41 http://ppa.launchpad.net/pinta-maintainers/pinta-stable/ubuntu xenial/main amd64 DEP-11 Metadata
Ign:42 http://ppa.launchpad.net/pinta-maintainers/pinta-stable/ubuntu xenial/main DEP-11 64x64 Icons
Fetched 4,395 kB in 17s (253 kB/s)
Reading package lists... Done
W: The repository 'http://ppa.launchpad.net/pinta-maintainers/pinta-stable/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/pinta-maintainers/pinta-stable/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