如何让两个版本的 Nativescript 共存?

How to have two versions of Nativescript co-exist?

我可以让两个版本的 Nativescript 共存吗?

在 pre 7 和 7+ 之间切换

谢谢。

您可以使用 npx 到 运行 多个版本的 nativescript。如果您使用的是 运行ning node 5.2 或更高版本,您应该默认拥有它。要 运行 除了全局安装的版本之外的不同版本的 nativescript,您可以 运行 以下命令:

// to create a new project with nativescript v6.5
npx nativescript@6.5 create newproject

// to run with nativescript v6.5
npx nativescript@6.5 run ios

要使用全局安装的 nativescript cli,您可以继续使用常规的 nativescript cli 命令(没有 npx)- ns run ios/ns create newproject