=====Configuration===== ====Proxy==== Exécuter : npm config set proxy http://xxx.yyy.zzz.aaa:80 =====Commandes===== ====install==== Installer dependencies et devDependencies : ''npm install'' Installer dependencies : ''npm install %%--%%production'' Installer devDependencies : ''npm install %%--%%dev'' =====Fichiers===== ====package.json==== ===Syntaxe des versions=== ^Version^Description^ |''version'' | Must match version exactly | |''>version'' | Must be greater than version | |''>=version'' | etc | |''=version1 %%<=%%version2''. | |''range1 || range2'' | Passes if either range1 or range2 are satisfied. | |''git%%...%%'' | See ‘Git URLs as Dependencies’ below | |''user/repo'' | See ‘GitHub URLs’ below | |''tag'' | A specific version tagged and published as tag See npm-dist-tag | |''path/path/path'' | See Local Paths below | [[https://docs.npmjs.com/files/package.json|Specifics of npm's package.json handling]] {{ :prog:nodejs:npm:npm-package.json_npm_documentation_2020-05-18_5_28_00_pm_.html |Archive le 18/05/2020}} [[https://michaelsoolee.com/npm-package-tilde-caret/|What's the difference between a tilde (~) and a caret (^) in a npm package.json file?]] {{ :prog:nodejs:npm:what_s_the_difference_between_a_tilde_and_a_caret_in_a_npm_package.json_file_michael_lee_2021-08-17_05_35_38_.html |Archive du 13/07/2017 le 17/08/2021}} ===Avoir la liste des versions d'un paquet=== npm view paquet versions --json ===Mettre à jour les paquets dans package-lock.json=== Il parait que la commande ci-dessous fonctionne. Mais pas chez moi. npm outdated npm update -dd npm install ===Mettre à jour les paquets dans package.json=== Installer le paquet ''npm-check-updates'' et exécuter la mise à jour. Attention, cela force la dernière mise à jour sans vérifier la compatibilité entre les paquets. npm i --location=global npm-check-updates npm-check-updates -u npm install =====Erreurs===== * ''npm WARN read-shrinkwrap This version of npm is compatible with lockfileVersion@1, but package-lock.json was generated for lockfileVersion@2. I'll try to do my best with it!'' Lancer un ''npm install -g npm''