Différences
Ci-dessous, les différences entre deux révisions de la page.
| Prochaine révision | Révision précédente | ||
|
prog:nodejs:nodejs [15/06/2019 19:59] thierry créée |
prog:nodejs:nodejs [17/09/2019 19:08] (Version actuelle) thierry [Installation] |
||
|---|---|---|---|
| Ligne 3: | Ligne 3: | ||
| * Télécharger node.js sur la page : [[https://nodejs.org/fr/download/]] | * Télécharger node.js sur la page : [[https://nodejs.org/fr/download/]] | ||
| - | Tester dans un CMD avec la commande npm -v: | + | Tester dans un CMD avec la commande ''npm -v'': |
| <code> | <code> | ||
| C:\Users\thierry>npm -v | C:\Users\thierry>npm -v | ||
| 6.9.0 | 6.9.0 | ||
| </code> | </code> | ||
| + | |||
| + | ===== Initialisation d'un projet avec NPM ===== | ||
| + | |||
| + | ''npm init -y'' créé un fichier package.json dans le répertoire de travail. | ||
| + | <code powershell>X:\wiki\test>npm init -y | ||
| + | Wrote to X:\wiki\test\package.json: | ||
| + | |||
| + | { | ||
| + | "name": "test", | ||
| + | "version": "1.0.0", | ||
| + | "description": "", | ||
| + | "main": "index.js", | ||
| + | "scripts": { | ||
| + | "test": "echo \"Error: no test specified\" && exit 1" | ||
| + | }, | ||
| + | "keywords": [], | ||
| + | "author": "", | ||
| + | "license": "ISC" | ||
| + | }</code> | ||