Closed XCarrel closed 5 years ago
Well, you ran the installer script for Node 11.x, but when you checked the binary, you have 4.8.2 installed. I'm not sure where that installation is coming from, but trying:
% dpkg -S $(which nodejs)
Might gain you some insight. But whatever's going on, that's not our version of Node you're seeing, as it would be 11.x. Hope this helps.
Sorry to insist, but it seems to me that I'm doing everything by the book and I end up with 4.8.2. :-(
What am I missing/doing wrong ? (sorry for the french texts)
root@debian239:~# # Verify that node is not installed
root@debian239:~# nodejs -v
-bash: /usr/bin/nodejs: Aucun fichier ou dossier de ce type
root@debian239:~# node -v
-bash: node : commande introuvable
root@debian239:~# npm -v
-bash: npm : commande introuvable
root@debian239:~# ls -al /usr/bin/nodejs
ls: impossible d'accéder à '/usr/bin/nodejs': Aucun fichier ou dossier de ce type
root@debian239:~#
root@debian239:~#
root@debian239:~# # install, based on https://github.com/nodesource/distributions#deb
root@debian239:~#
root@debian239:~# apt-get clean
root@debian239:~# curl -sL https://deb.nodesource.com/setup_11.x | bash -
## Installing the NodeSource Node.js 11.x repo...
## Populating apt-get cache...
+ apt-get update
Ign:1 http://ftp.ch.debian.org/debian stretch InRelease
Atteint:2 http://ftp.ch.debian.org/debian stretch-updates InRelease
Atteint:3 http://ftp.ch.debian.org/debian stretch Release
Atteint:4 http://security.debian.org/debian-security stretch/updates InRelease
Atteint:5 https://deb.nodesource.com/node_11.x stretch InRelease
Atteint:8 https://packages.sury.org/php stretch InRelease
Lecture des listes de paquets... Fait
## Confirming "stretch" is supported...
+ curl -sLf -o /dev/null 'https://deb.nodesource.com/node_11.x/dists/stretch/Release'
## Adding the NodeSource signing key to your keyring...
+ curl -s https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add -
OK
## Creating apt sources list file for the NodeSource Node.js 11.x repo...
+ echo 'deb https://deb.nodesource.com/node_11.x stretch main' > /etc/apt/sources.list.d/nodesource.list
+ echo 'deb-src https://deb.nodesource.com/node_11.x stretch main' >> /etc/apt/sources.list.d/nodesource.list
## Running `apt-get update` for you...
+ apt-get update
Atteint:1 http://security.debian.org/debian-security stretch/updates InRelease
Ign:2 http://ftp.ch.debian.org/debian stretch InRelease
Atteint:3 http://ftp.ch.debian.org/debian stretch-updates InRelease
Atteint:4 http://ftp.ch.debian.org/debian stretch Release
Atteint:5 https://deb.nodesource.com/node_11.x stretch InRelease
Atteint:6 https://packages.sury.org/php stretch InRelease
Lecture des listes de paquets... Fait
## Run `sudo apt-get install -y nodejs` to install Node.js 11.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 | sudo apt-key add -
echo "deb 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
root@debian239:~# apt-get install -y nodejs
Lecture des listes de paquets... Fait
Construction de l'arbre des dépendances
Lecture des informations d'état... Fait
Les NOUVEAUX paquets suivants seront installés :
nodejs
0 mis à jour, 1 nouvellement installés, 0 à enlever et 4 non mis à jour.
Il est nécessaire de prendre 3'422 ko dans les archives.
Après cette opération, 13.5 Mo d'espace disque supplémentaires seront utilisés.
Réception de:1 http://ftp.ch.debian.org/debian stretch/main i386 nodejs i386 4.8.2~dfsg-1 [3'422 kB]
3'422 ko réceptionnés en 6s (510 ko/s)
Sélection du paquet nodejs précédemment désélectionné.
(Lecture de la base de données... 41767 fichiers et répertoires déjà installés.)
Préparation du dépaquetage de .../nodejs_4.8.2~dfsg-1_i386.deb ...
Dépaquetage de nodejs (4.8.2~dfsg-1) ...
Paramétrage de nodejs (4.8.2~dfsg-1) ...
update-alternatives: utilisation de « /usr/bin/nodejs » pour fournir « /usr/bin/js » (js) en mode automatique
Traitement des actions différées (« triggers ») pour man-db (2.7.6.1-2) ...
root@debian239:~#
root@debian239:~#
root@debian239:~#
root@debian239:~# # check result
root@debian239:~#
root@debian239:~# node -v
-bash: node : commande introuvable
root@debian239:~# nodejs -v
v4.8.2
root@debian239:~# npm -v
-bash: npm : commande introuvable
root@debian239:~# ls -al /usr/bin/nodejs
-rwxr-xr-x 1 root root 10582308 avr 4 2017 /usr/bin/nodejs
root@debian239:~# dpkg -S $(which nodejs)
nodejs: /usr/bin/nodejs
Ah, I see the problem now. The issue you're having is that you are installing on a 32bit (i386
) system, and there are no builds of 11.x for that architecture. The last version that the Node foundation makes 32bit builds for was 8.x. So if you run the installer script for 8.x, it should work. If you want a version of Node newer than 8.x, you'll need to compile it yourself or use a 64bit machine. Hope this helps.
That was exactly it !!! Thank you SOOOOOO much !
I have a Debian 9 (stretch) machine on which I need npm (managing dependencies in a Laravel project).
Installed nodejs with
no problem detected during install
node works fine:
but npm is nowhere to be found:
Tried the proposed 'Manual Install' -> same thing
I read quite a few posts around the web, but nothing worked.
I'm at my wits' end ... can someone help please ?