[Node] Run Any Version of a Node Tool with npx

As node projects evolve, new features are added all the time. This results in different errors or results as you're migrating from one version to another. npx allows you to try out any version you want by simply adding the version number to the project you're using. This lesson covers using the TypeScript compiler through a different versions as async function support was added.

Install:

npm install -g npx

Usage:

npx typescript@1.6 index.ts
npx typescript --target es2017 index.ts // Use the latest version
原文地址:https://www.cnblogs.com/Answer1215/p/7211968.html