How do I update path npx version?

Viewed 12776

When I run npx --version, it returns me v6.x.x

But after I do npm install -g npx, yarn global add npx, and it shows successful download of npx v10, running npx --version still returns me v6.x.x

Running where npx gives me:

C:\Program Files\nodejs\npx
C:\Program Files\nodejs\npx.cmd
C:\Users\Samson\AppData\Roaming\npm\npx
C:\Users\Samson\AppData\Roaming\npm\npx.cmd
1 Answers

Ran into the same issue, this is what worked for me:

  1. Delete each one of the files listed in the output of where npx, for example del "C:\Program Files\nodejs\npx"

  2. Run npm uninstall -g npx

  3. Run npm install -g npx@10.2.2 (or whatever version you want to install)

After doing these steps, when I run npx --version I see the correct one, and the issue that required me to upgrade npx is fixed.

Related