Outdated "Upgrading on Windows" - obsolete workarounds?

Aperta Adatta ai principianti
#1,998 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
72/100
Tipo di issue
Documentazione
Chiarezza
Abbastanza chiara
Stato di attività
Tranquilla
Stack tecnologico
node.js
Ambito
documentation

Direzione di ricerca

Inizia dalla sezione «Upgrading on Windows» della pagina della documentazione di npm collegata e verifica le relative affermazioni confrontandole con il comportamento segnalato di Node.js 22, 24 e 26. Verifica i comandi e le soluzioni alternative documentati in Windows, quindi modifica la sezione in modo che rifletta accuratamente le versioni attualmente supportate e rimuovi le indicazioni obsolete.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Description

In a 64-bit Node.js installation on Windows 11 25H2,

  • C:\Program Files\nodejs\ is added to the system PATH environment variable
  • C:\Users\%USERNAME%\AppData\Roaming\npm is added to the user PATH environment variable

and the system PATH takes precedence over the user PATH. This is correctly described.

The statement:

... it will always use the version of npm installed with node instead of the version of npm you installed using npm -g install npm@<version>.

does not hold true for Node.js 26.4.0, nor for the lowest currently supported Node.js 22.33.1.

The workarounds that are described, appear to be unnecessary and obsolete.

Steps to reproduce

  1. Install https://nodejs.org/dist/v26.4.0/node-v26.4.0-x64.msi with bundled npm 11.17.0 on Windows 11 25H2
  2. In a cmd command terminal window execute echo %PATH% and confirm the priority is:
    1. C:\Program Files\nodejs\
    2. C:\Users\%USERNAME%\AppData\Roaming\npm
  3. Execute npm --version and confirm that the version shown is 11.17.0
  4. Execute npm install [email protected] -g
  5. Execute npm --version and confirm that the version shown is 11.18.0
  6. Repeat npm --version in the following and confirm they also show npm 11.18.0
    1. Windows PowerShell 5.1
    2. PowerShell 7.6.3
    3. Git Bash

Repeat for Node.js 22.33.1 with bundled npm 10.9.8. Update to [email protected].

Suggested solution

Review and revise the documentation section for accuracy regarding currently supported versions of Node.js 22, 24 & 26.

URL

https://docs.npmjs.com/try-the-latest-stable-version-of-npm#upgrading-on-windows

Lingua principale
MDX
Stelle
728
Fork
4.3k
Merge medio
22h 39m
PR unite (30g)
3

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di npm/documentation

Tutte le issue di npm/documentation

Issue simili

Altre issue su Documentation

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.