Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] npx node@12 executes node@16 #4204

Closed
2 tasks done
Kreijstal opened this issue Jan 2, 2022 · 6 comments
Closed
2 tasks done

[BUG] npx node@12 executes node@16 #4204

Kreijstal opened this issue Jan 2, 2022 · 6 comments
Labels
Bug thing that needs fixing cmd:exec related to `npx` Needs Triage needs review for next steps platform:windows is Windows-specific Release 8.x work is associated with a specific npm 8 release

Comments

@Kreijstal
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

This issue exists in the latest npm version

  • I am using the latest npm

Current Behavior

Documentation says you can specify node version with npx, but right now, when using npx node@12 it executes latest version instead

Expected Behavior

Execute latest version

Steps To Reproduce

run npx node@12 with node 16, install it, and then see the version.

Environment

  • npm: 7.24.0
  • Node: v16.10.0
  • OS: Windows 10
  • platform: Acer
  • npm config:
; "builtin" config from C:\Users\k\scoop\apps\nodejs\16.10.0\node_modules\npm\npmrc

cache = "C:\\Users\\k\\scoop\\persist\\nodejs\\cache"
prefix = "C:\\Users\\k\\scoop\\persist\\nodejs\\bin"

; node bin location = C:\Users\k\scoop\apps\nodejs\current\node.exe
; cwd = C:\Users\k\ok\node-ffi-test
; HOME = C:\Users\k
; Run `npm config ls -l` to show all defaults.
@Kreijstal Kreijstal added Bug thing that needs fixing Needs Triage needs review for next steps Release 8.x work is associated with a specific npm 8 release labels Jan 2, 2022
@ljharb
Copy link
Contributor

ljharb commented Jan 2, 2022

So if you run npx node@12 --version what do you get?

@ljharb
Copy link
Contributor

ljharb commented Jan 2, 2022

(not that the node package on npm is a good way to use different versions of node)

@Kreijstal
Copy link
Author

npx node@12 --version
v16.10.0

@ljharb
Copy link
Contributor

ljharb commented Jan 2, 2022

You’re on npm 7, can you try on npm 8?

@Kreijstal
Copy link
Author

updated node and npm versions

C:\Users\k\ok\node-ffi-test>npm -v
8.3.0

C:\Users\k\ok\node-ffi-test>npx node@12 --version
v17.3.0

@nlf nlf added the platform:windows is Windows-specific label Jan 4, 2022
@fritzy fritzy added the cmd:exec related to `npx` label Jul 25, 2022
@wraithgar
Copy link
Member

This should be fixed as of [email protected]

~/D/n/s/npx $ node --version
v18.6.0
~/D/n/s/npx $ npx node@12 --version
Need to install the following packages:
  [email protected]
Ok to proceed? (y) 
v12.22.12

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug thing that needs fixing cmd:exec related to `npx` Needs Triage needs review for next steps platform:windows is Windows-specific Release 8.x work is associated with a specific npm 8 release
Projects
None yet
Development

No branches or pull requests

5 participants