Installer NPM sur Debian Wheezy

On fait comme ceci (en root) :

echo "deb http://ftp.us.debian.org/debian wheezy-backports main" >> /etc/apt/sources.list
apt-get update
apt-get install nodejs-legacy
curl -L --insecure https://www.npmjs.org/install.sh | bash

Ou bien, si on n’a pas envie d’ajouter les dépôts Backports, on télécharge le paquet nodejs-legacy ici,  on l’installe avec dpkg -i, et on exécute simplement :

curl -L --insecure https://www.npmjs.org/install.sh | bash

Source.

Note : Je ne vais pas expliquer ce qu’est NPM. Si vous êtes arrivé ici parce que vous en avez besoin, vous avez votre réponse. Si vous êtes arrivé par hasard, vous n’en avez probablement pas besoin.

 

Ce contenu a été publié dans Astuces, Informatique. Vous pouvez le mettre en favoris avec ce permalien.

7 réponses à Installer NPM sur Debian Wheezy

  1. GDG dit :

    Merci pour l’info debug
    GB

  2. Romain B. dit :

    Bonjour,

    merci pour ce partage

    lors de la dernière commande, j’obtiens ceci :

    # curl -L –insecure https://ww w.npmjs.org/install.sh | bash
    % Total % Received % Xferd Average Speed Time Time Time Current
    Dload Upload Total Spent Left Speed
    0 51 0 0 0 0 0 0 –:–:– –:–:– –:–:– 0
    100 6263 100 6263 0 0 6493 0 –:–:– –:–:– –:–:– 6116k
    tar=/bin/tar
    version:
    tar (GNU tar) 1.26
    Copyright (C) 2011 Free Software Foundation, Inc.
    License GPLv3+: GNU GPL version 3 or later .
    This is free software: you are free to change and redistribute it.
    There is NO WARRANTY, to the extent permitted by law.

    Written by John Gilmore and Jay Fenlason.
    install npm@latest
    fetching: https://registry.npmjs.org/npm/-/npm-4.6.1.tgz
    npm ERR! Object function (err) {
    npm ERR! if (err) return cb(err)
    npm ERR! fs.fsync(fd, function (err) {
    npm ERR! if (err) return cb(err)
    npm ERR! fs.close(fd, cb)
    npm ERR! })
    npm ERR! } has no method ‘toLowerCase’
    It failed

    Une idée d’où ça peut venir ?

    Merci

  3. jmarandet dit :

    Cette procédure ne m’a pas aidé non plus malheureusement (Debian-7 3.2)

    La dernière commande ayant donné :

    webdev@debian-7:~$ sudo curl -L --insecure https://www.npmjs.org/install.sh | bash
    % Total % Received % Xferd Average Speed Time Time Time Current
    Dload Upload Total Spent Left Speed
    0 51 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
    100 6255 100 6255 0 0 6337 0 --:--:-- --:--:-- --:--:-- 1221k
    tar=/bin/tar
    version:
    tar (GNU tar) 1.26
    Copyright © 2011 Free Software Foundation, Inc.
    Licence GPLv3+ : GNU GPL version 3 ou ultérieure
    Ceci est un logiciel libre : vous êtes libre de le modifier et de le redistribuer.
    Il est fourni SANS GARANTIE, dans la mesure de ce que permet la loi.

    Écrit par John Gilmore et Jay Fenlason.
    install npm@latest
    fetching: https://registry.npmjs.org/npm/-/npm-5.0.4.tgz

    /tmp/npm.4070/package/lib/uninstall.js:6
    const path = require('path')
    ^^^^^
    npm ERR! Use of const in strict mode.

    npm ERR! A complete log of this run can be found in:
    npm ERR! /home/webdev/.npm/_logs/2017-07-03T08_21_19_200Z-debug.log

    /tmp/npm.4070/package/lib/install.js:298
    [this, (next) => { computeMetadata(this.idealTree); next() }],
    ^
    npm ERR! Unexpected token >

    npm ERR! A complete log of this run can be found in:
    npm ERR! /home/webdev/.npm/_logs/2017-07-03T08_21_19_371Z-debug.log
    It failed

    Par contre, voici tout simplement où j’ai trouvé la solution :
    https://nodejs.org/en/download/package-manager/

    Avec les instructions suivantes :

    curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
    sudo apt-get install -y nodejs

  4. AlloSchool dit :

    Merci beaucoup,
    Pour la deuxiéme étape, j’ai eu une erreur « need latest nodejs … » mais ceci marche :

    apt-get install nodejs

    Encore merci,

Répondre à jmarandet Annuler la réponse.

Votre adresse de messagerie ne sera pas publiée. Les champs obligatoires sont indiqués avec *

Vous pouvez utiliser ces balises et attributs HTML : <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>