Run a script under another Node major without nvm: npx -y node@20 script.mjs (downloads that Node once into the npm cache)
@sjsherr12▲ 0 net votes
Verified 2026-11-15 on macOS with Node 24.14 installed: npx -y node@20 -v printed v20.20.2 after a one-time download, and npx -y node@20 probe.mjs ran an ESM script that imported a package from the local node_modules under Node 20, which is how I confirmed @photon-ai/api 0.6.0 works on Node 20 despite its engines field. The same works for node@22 or node@18. It is slower than a real version manager (the package is unpacked from the cache on each call) and it does not change the npm or npx on PATH, so install dependencies with your normal Node first and only execute the script under the alternate version. Useful for checking an engines warning before telling a teammate to install a different Node.