distributions icon indicating copy to clipboard operation
distributions copied to clipboard

it don't install npm, just nodejs

Open yessith93 opened this issue 4 years ago • 6 comments

i followed your instruction, and I could install nodejs but I can't execute npm

yessith93 avatar Oct 22 '21 20:10 yessith93

I have the same problem

euphoriaer avatar Oct 24 '21 04:10 euphoriaer

Same problem here, but on my Lubuntu 18.04.5, it seems to install nodejs from ubuntu's repositories, completely ignoring repositories set up by nodesource.

Output:

gartraukis@gartraukis:~$ curl -fsSL https://deb.nodesource.com/setup_16.x | sudo -E bash -

## Installing the NodeSource Node.js 16.x repo...


## Populating apt-get cache...

+ apt-get update
Hit:1 http://lt.archive.ubuntu.com/ubuntu bionic InRelease
Hit:2 http://lt.archive.ubuntu.com/ubuntu bionic-updates InRelease
Hit:3 http://lt.archive.ubuntu.com/ubuntu bionic-backports InRelease
Get:4 http://security.ubuntu.com/ubuntu bionic-security InRelease [88.7 kB]    
Fetched 88.7 kB in 2s (37.4 kB/s)                                              
Reading package lists... Done

## Confirming "bionic" is supported...

+ curl -sLf -o /dev/null 'https://deb.nodesource.com/node_16.x/dists/bionic/Release'

## Adding the NodeSource signing key to your keyring...

+ curl -s https://deb.nodesource.com/gpgkey/nodesource.gpg.key | gpg --dearmor | tee /usr/share/keyrings/nodesource.gpg >/dev/null
gpg: WARNING: unsafe ownership on homedir '/home/gartraukis/.gnupg'

## Creating apt sources list file for the NodeSource Node.js 16.x repo...

+ echo 'deb [signed-by=/usr/share/keyrings/nodesource.gpg] https://deb.nodesource.com/node_16.x bionic main' > /etc/apt/sources.list.d/nodesource.list
+ echo 'deb-src [signed-by=/usr/share/keyrings/nodesource.gpg] https://deb.nodesource.com/node_16.x bionic main' >> /etc/apt/sources.list.d/nodesource.list

## Running `apt-get update` for you...

+ apt-get update
Hit:1 http://lt.archive.ubuntu.com/ubuntu bionic InRelease
Hit:2 http://lt.archive.ubuntu.com/ubuntu bionic-updates InRelease
Hit:3 http://lt.archive.ubuntu.com/ubuntu bionic-backports InRelease
Get:4 http://security.ubuntu.com/ubuntu bionic-security InRelease [88.7 kB]                                                      
Get:5 https://deb.nodesource.com/node_16.x bionic InRelease [4584 B]                                                             
Fetched 93.3 kB in 3s (35.3 kB/s)                                                                            
Reading package lists... Done

## Run `sudo apt-get install -y nodejs` to install Node.js 16.x and npm
## You may also need development tools to build native addons:
     sudo apt-get install gcc g++ make
## To install the Yarn package manager, run:
     curl -sL https://dl.yarnpkg.com/debian/pubkey.gpg | gpg --dearmor | sudo tee /usr/share/keyrings/yarnkey.gpg >/dev/null
     echo "deb [signed-by=/usr/share/keyrings/yarnkey.gpg] https://dl.yarnpkg.com/debian stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
     sudo apt-get update && sudo apt-get install yarn


gartraukis@gartraukis:~$ sudo apt-get install -y nodejs
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following package was automatically installed and is no longer required:
  libllvm6.0
Use 'sudo apt autoremove' to remove it.
The following additional packages will be installed:
  libc-ares2 libhttp-parser2.7.1 libuv1 nodejs-doc
The following NEW packages will be installed:
  libc-ares2 libhttp-parser2.7.1 libuv1 nodejs nodejs-doc
0 upgraded, 5 newly installed, 0 to remove and 222 not upgraded.
Need to get 5728 kB of archives.
After this operation, 24.4 MB of additional disk space will be used.
Get:1 http://lt.archive.ubuntu.com/ubuntu bionic/main i386 libuv1 i386 1.18.0-3 [70.0 kB]
Get:2 http://lt.archive.ubuntu.com/ubuntu bionic-updates/universe i386 nodejs-doc all 8.10.0~dfsg-2ubuntu0.4 [752 kB]
Get:3 http://lt.archive.ubuntu.com/ubuntu bionic-updates/main i386 libc-ares2 i386 1.14.0-1ubuntu0.1 [40.2 kB]
Get:4 http://lt.archive.ubuntu.com/ubuntu bionic/main i386 libhttp-parser2.7.1 i386 2.7.1-2 [20.9 kB]
Get:5 http://lt.archive.ubuntu.com/ubuntu bionic-updates/universe i386 nodejs i386 8.10.0~dfsg-2ubuntu0.4 [4845 kB]
Fetched 5728 kB in 5s (1087 kB/s) 
Selecting previously unselected package libuv1:i386.
(Reading database ... 141324 files and directories currently installed.)
Preparing to unpack .../libuv1_1.18.0-3_i386.deb ...
Unpacking libuv1:i386 (1.18.0-3) ...
Selecting previously unselected package nodejs-doc.
Preparing to unpack .../nodejs-doc_8.10.0~dfsg-2ubuntu0.4_all.deb ...
Unpacking nodejs-doc (8.10.0~dfsg-2ubuntu0.4) ...
Selecting previously unselected package libc-ares2:i386.
Preparing to unpack .../libc-ares2_1.14.0-1ubuntu0.1_i386.deb ...
Unpacking libc-ares2:i386 (1.14.0-1ubuntu0.1) ...
Selecting previously unselected package libhttp-parser2.7.1:i386.
Preparing to unpack .../libhttp-parser2.7.1_2.7.1-2_i386.deb ...
Unpacking libhttp-parser2.7.1:i386 (2.7.1-2) ...
Selecting previously unselected package nodejs.
Preparing to unpack .../nodejs_8.10.0~dfsg-2ubuntu0.4_i386.deb ...
Unpacking nodejs (8.10.0~dfsg-2ubuntu0.4) ...
Setting up nodejs-doc (8.10.0~dfsg-2ubuntu0.4) ...
Setting up libhttp-parser2.7.1:i386 (2.7.1-2) ...
Setting up libuv1:i386 (1.18.0-3) ...
Setting up libc-ares2:i386 (1.14.0-1ubuntu0.1) ...
Setting up nodejs (8.10.0~dfsg-2ubuntu0.4) ...
update-alternatives: using /usr/bin/nodejs to provide /usr/bin/js (js) in auto mode
Processing triggers for man-db (2.8.3-2ubuntu0.1) ...
Processing triggers for libc-bin (2.27-3ubuntu1.2) ...
gartraukis@gartraukis:~/tweets$ apt-cache policy nodejs
nodejs:
  Installed: 8.10.0~dfsg-2ubuntu0.4
  Candidate: 8.10.0~dfsg-2ubuntu0.4
  Version table:
 *** 8.10.0~dfsg-2ubuntu0.4 500
        500 http://lt.archive.ubuntu.com/ubuntu bionic-updates/universe i386 Packages
        100 /var/lib/dpkg/status
     8.10.0~dfsg-2ubuntu0.2 500
        500 http://security.ubuntu.com/ubuntu bionic-security/universe i386 Packages
     8.10.0~dfsg-2 500
        500 http://lt.archive.ubuntu.com/ubuntu bionic/universe i386 Packages

WeaselScience avatar Oct 29 '21 09:10 WeaselScience

Can confirm. Only node gets upgraded (v14 -> v16), npm stays the old version (v6) not the bundled one (v8).

changke avatar Oct 30 '21 06:10 changke

+1

DevDengChao avatar Nov 17 '21 08:11 DevDengChao

+1

123Mr-king avatar Feb 25 '22 04:02 123Mr-king

can confirm and then additionally when I use the command to install n v18, I end up with v12 on Ubuntu 22

TimDaub avatar Sep 28 '22 11:09 TimDaub

When this problem happens there is usually an error in your environment which causes our package not to be installed. Can you give us more information?

JesusPaz avatar Jan 03 '23 16:01 JesusPaz