我最近在macOS上的Sidekick应用程序中注意到,已经发布了新版本的CLI,并且需要更新。
我退出Sidekick并在终端中运行“ sudo tns i -g nativescript @ latest --unsafe-perm”命令,结果如下:
+ nativescript@5.1.1
updated 67 packages in 14.325s
当我尝试启动Sidekick时,出现以下错误: Sidekick prompt
我回到终端并运行“ tns doctor”,结果如下:
✔ Getting environment information
No issues were detected.
✔ Your ANDROID_HOME environment variable is set and points to correct directory.
✔ Your adb from the Android SDK is correctly installed.
✔ The Android SDK is installed.
✔ A compatible Android SDK for compilation is found.
✔ Javac is installed and is configured properly.
✔ The Java Development Kit (JDK) is installed and is configured properly.
✔ Xcode is installed and is configured properly.
✔ xcodeproj is installed and is configured properly.
✔ CocoaPods are installed.
✔ CocoaPods update is not required.
✔ CocoaPods are configured properly.
✔ Your current CocoaPods version is newer than 1.0.0.
✔ Python installed and configured correctly.
✔ The Python 'six' package is found.
✔ Xcode version 10.1.0 satisfies minimum required version 9.
✔ Getting NativeScript components versions information...
⚠ Update available for component nativescript. Your current version is 5.1.0 and the latest available version is 5.1.1.
tns医生或 Sidekick 似乎都无法识别该更新,我该怎么办才能解决此问题?
答案 0 :(得分:0)
您有nvm
吗?当终端中的设置与全局设置不同时,可能会发生这种情况。例如,可以在终端中使用一个节点版本,而从全局安装的Sidekick中使用另一个节点版本。
答案 1 :(得分:0)
您不应该使用sudo
-有关如何通过在执行NPM安装时消除对超级用户的需求来解决此问题的详细信息,请参见this blog post。类似线程here
答案 2 :(得分:0)
在tns doctor命令中,我们收到以下消息:Getting NativeScript components versions information...
尝试更新后为:sudo npm install nativescript -g --unsafe-perm
之后,我们收到了很多错误消息。
使用以下简单命令即可解决:
tns proxy clear
然后运行:sudo npm install nativescript -g --unsafe-perm
解决了!