Ci-dessous, les différences entre deux révisions de la page.
| Les deux révisions précédentesRévision précédenteProchaine révision | Révision précédente | ||
| linux:nodejs [07-02-2017 14:58] – edmc73 | linux:nodejs [11-12-2023 23:55] (Version actuelle) – edmc73 | ||
|---|---|---|---|
| Ligne 3: | Ligne 3: | ||
| ===== Installation ===== | ===== Installation ===== | ||
| Installation, | Installation, | ||
| + | |||
| + | Utiliser la dernière méthode | ||
| + | |||
| + | https:// | ||
| + | |||
| + | |||
| + | < | ||
| + | sudo apt-get update | ||
| + | sudo apt-get install -y ca-certificates curl gnupg | ||
| + | sudo mkdir -p / | ||
| + | curl -fsSL https:// | ||
| + | </ | ||
| + | |||
| + | Important de rajouter le ARCH qui n'est pas mentionné dans la doc officiel | ||
| + | < | ||
| + | NODE_MAJOR=18 | ||
| + | ARCH=amd64 | ||
| + | echo "deb [arch=$ARCH signed-by=/ | ||
| + | </ | ||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | CE QUI SUIT DEVIENT OBSOLETE !!! | ||
| Utilisez la démarche décrite sur le site officiel => https:// | Utilisez la démarche décrite sur le site officiel => https:// | ||
| - | curl -sL https://deb.nodesource.com/setup_7.x | sudo -E bash - | + | => https://github.com/nodesource/ |
| - | sudo apt-get install -y nodejs | + | |
| - | | + | < |
| - | | + | curl -sL https:// |
| - | # nodejs | + | |
| - | | + | ## 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:// | ||
| + | echo "deb https:// | ||
| + | sudo apt-get update && sudo apt-get install yarn | ||
| + | |||
| + | |||
| + | apt-get install nodejs | ||
| + | </ | ||
| + | |||
| + | # npm -v | ||
| + | | ||
| + | # node -v | ||
| + | | ||
| + | |||
| + | En cas de problème, n' | ||
| + | rm -fr ~/.npm | ||
| + | rm -fr /root/.npm | ||
| ===== Mettre à jour ===== | ===== Mettre à jour ===== | ||
| + | npm | ||
| + | |||
| + | npm -g install npm@latest | ||
| + | |||
| + | nodeJS | ||
| npm cache clean -f | npm cache clean -f | ||
| npm install -g n | npm install -g n | ||
| n stable | n stable | ||