如果我先运行npm uninstall -g nativescript,然后运行npm install -g nativescript,它会安装4.1.2,而不是最新版本5.4.2。
我试着通过重新安装来升级我的原生脚本,但是它仍然不能升级,有人有什么想法吗?
发布于 2019-06-24 13:56:55
在执行npm install -g nativescript时,不可能得到4.1.2。
最有可能的是,您的计算机上安装了多个nativescript命令行界面。您可以通过执行以下命令来解决此问题:
`which tns` (or `where tns` on Windows) - it will return the problematic `tns` 4.1.2. location.
`npm get prefix` - this is the location of your global npm modules where will be your nativescript@5.4.2.
`echo $PATH` - I suppose that the problematic `tns` location will be before the global npm modules location in your `PATH` variable.要开始使用5.4.2CLI,您只需在NativeScript 4.1.2之前修复npm值并设置全局$PATH模块位置。
发布于 2019-06-25 08:21:00
这是nvm。我更新到节点12,但Nativescript不兼容。伙伴真的很奇怪。它一直在尝试安装cli,但无法安装。我切换回错误的nvm,它安装了4.1.2。一直都是我的错。Sidekick似乎选择了最新的nvm版本,而不是您选择运行的版本。一旦我卸载了节点12,它就会恢复到正确的版本。
https://stackoverflow.com/questions/56712044
复制相似问题