Aller au contenu

« Node.js » : différence entre les versions

De Marmits Wiki
Aucun résumé des modifications
Aucun résumé des modifications
 
(2 versions intermédiaires par le même utilisateur non affichées)
Ligne 1 : Ligne 1 :
== Nvm ==
(plusieurs versions nodejs)


=== Installation ===
Voir les dernieres releases pour adapter le curl install.sh
[https://github.com/nvm-sh/nvm/releases github.com/nvm-sh/nvm/releases]
<syntaxhighlight lang="bash" line copy>
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
</syntaxhighlight>
<syntaxhighlight lang="bash" line copy>
source ~/.bashrc
</syntaxhighlight>
=== Commande ===
Voir les versions disponibles.
<syntaxhighlight lang="bash" line copy>
nvm ls-remote
</syntaxhighlight>
Installer la dernière version stable :
<syntaxhighlight lang="bash" line copy>
nvm install node
</syntaxhighlight>
Installer la deniere version  LTS de nodejs
<syntaxhighlight lang="bash" line copy>
nvm install --lts
</syntaxhighlight>
Installer une version
<syntaxhighlight lang="bash" line copy>
nvm install 20
</syntaxhighlight>
Définis une version par défaut
<syntaxhighlight lang="bash" line copy>
nvm alias default 20
</syntaxhighlight>
Utilise une version spécifique
<syntaxhighlight lang="bash" line copy>
nvm ls
nvm use 16
</syntaxhighlight>
Vérifier l'installation
<syntaxhighlight lang="bash" line copy>
node -v
npm -v
</syntaxhighlight>
Définir cette version comme version par défaut
<syntaxhighlight lang="bash" line copy>
nvm alias default node
</syntaxhighlight>
== Ressources ==
  [https://talks.freelancerepublik.com/tutoriel-module-npm/ tutoriel-module-npm]
  [https://talks.freelancerepublik.com/tutoriel-module-npm/ tutoriel-module-npm]
  [https://www.data-transitionnumerique.com/npm-nodejs/ Comment installer un paquet npm depuis GitHub ?]
  [https://www.data-transitionnumerique.com/npm-nodejs/ Comment installer un paquet npm depuis GitHub ?]
Ligne 8 : Ligne 66 :
  [https://delicious-insights.com/fr/articles/libs-node-js/ Des modules]
  [https://delicious-insights.com/fr/articles/libs-node-js/ Des modules]
  [https://adrienjoly.com/cours-nodejs/ Cours node]
  [https://adrienjoly.com/cours-nodejs/ Cours node]




  [[category:Labo]] [[category:Dev]]
  [[category:Labo]] [[category:Dev]]

Dernière version du 6 juin 2025 à 09:17

Nvm

(plusieurs versions nodejs)

Installation

Voir les dernieres releases pour adapter le curl install.sh github.com/nvm-sh/nvm/releases

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
source ~/.bashrc

Commande

Voir les versions disponibles.

nvm ls-remote

Installer la dernière version stable :

nvm install node

Installer la deniere version LTS de nodejs

nvm install --lts

Installer une version

nvm install 20

Définis une version par défaut

nvm alias default 20

Utilise une version spécifique

nvm ls
nvm use 16

Vérifier l'installation

node -v
npm -v

Définir cette version comme version par défaut

nvm alias default node

Ressources

tutoriel-module-npm
Comment installer un paquet npm depuis GitHub ?
Le moyen le plus simple de créer un premier package NPM
--- 
OpenClassRooms Node.js
API avec Nodes.js
Des modules
Cours node