永久 NativeScript Mac 安装问题
Perpetual NativeScript Mac Installation Issues
我真的需要别人的帮助,因为我已经解决这个问题很长时间了,但没有任何补救措施。
问题只是将 NativeScript CLI 安装到我的 OSX Yosemite Mac 上。我按照 NS 网站的步骤进行操作(安装正确的 Node.JS 版本,下载 Xcode 7.2(由于 OS 限制),安装 JSDK,安装 NS Sidekick,安装 Android Studio w/适当的 SDK 以及所有其他必需的依赖项。
但是,当我 运行 "sudo npm i -g nativescript --unsafe-perm" (否则它会抛出 EACCES 错误)时,我得到以下日志,说我缺少所有这些我知道的依赖项,但它是声称我没有。
最大的问题是,虽然它仍然会说 NativeScript 已成功安装,但每当我 运行 任何 tns 命令(如 tns doctor)时,都找不到 bash 命令。
我已确保遵循将 NS 添加到我的路径以及我的 Android 和 Java SDK 的说明。这是完整的日志:
jsmbp:~ Js$ sudo npm i -g nativescript --unsafe-perm
Password:
/Users/Jmsquillaro/.npm-packages/bin/nativescript -> /Users/Jmsquillaro/.npm-packages/lib/node_modules/nativescript/bin/tns
/Users/Jmsquillaro/.npm-packages/bin/tns -> /Users/Jmsquillaro/.npm-packages/lib/node_modules/nativescript/bin/tns
> fsevents@1.1.2 install /Users/Jmsquillaro/.npm-packages/lib/node_modules/nativescript/node_modules/fsevents
> node install
[fsevents] Success: "/Users/Jmsquillaro/.npm-packages/lib/node_modules/nativescript/node_modules/fsevents/lib/binding/Release/node-v48-darwin-x64/fse.node" already installed
Pass --update-binary to reinstall or --build-from-source to recompile
> nativescript@3.3.1 postinstall /Users/Jmsquillaro/.npm-packages/lib/node_modules/nativescript
> node postinstall.js
WARNING: adb from the Android SDK is not installed or is not configured properly.
For Android-related operations, the NativeScript CLI will use a built-in version of adb.
To avoid possible issues with the native Android emulator, Genymotion or connected
Android devices, verify that you have installed the latest Android SDK and
its dependencies as described in http://developer.android.com/sdk/index.html#Requirements
TIP: To avoid setting up the necessary environment variables, you can use the Homebrew package manager to install the Android SDK and its dependencies.
WARNING: The Android SDK is not installed or is not configured properly.
You will not be able to build your projects for Android and run them in the native emulator.
To be able to build for Android and run apps in the native emulator, verify that you have
installed the latest Android SDK and its dependencies as described in http://developer.android.com/sdk/index.html#Requirements
TIP: To avoid setting up the necessary environment variables, you can use the Homebrew package manager to install the Android SDK and its dependencies.
WARNING: CocoaPods is not installed or is not configured properly.
You will not be able to build your projects for iOS if they contain plugin with CocoaPod file.
To be able to build such projects, verify that you have installed CocoaPods.
The ANDROID_HOME environment variable is not set or it points to a non-existent directory. You will not be able to perform any build-related operations for Android.
To be able to perform Android build-related operations, set the ANDROID_HOME variable to point to the root of your Android SDK installation directory.
Cannot find a compatible Android SDK for compilation. To be able to build for Android, install Android SDK 22 or later.
Run $ sdkmanager to manage your Android SDK versions.
You need to have the Android SDK Build-tools installed on your system. You can install any version in the following range: '>=23 <=26'.
Run $ sdkmanager from your command-line to install required Android Build Tools. In case you already have them installed, make sure ANDROID_HOME environment variable is set correctly.
You need to have Android SDK 22 or later and the latest Android Support Repository installed on your system.
Run $ sdkmanager to manage the Android Support Repository. In case you already have it installed, make sure ANDROID_HOME environment variable is set correctly.
Error executing command 'javac'. Make sure you have installed The Java Development Kit (JDK) and set JAVA_HOME environment variable.
You will not be able to build your projects for Android.
To be able to build for Android, verify that you have installed The Java Development Kit (JDK) and configured it according to system requirements as
described in http://docs.nativescript.org/setup/ns-cli-setup/ns-setup-os-x.html#system-requirements
There seem to be issues with your configuration.
? Do you want to visit the official documentation? No
? Do you want to run the setup script? No
Your components are up-to-date:
nativescript,tns-core-modules,tns-android,tns-ios
Autocompletion is already enabled
Installation successful. You are good to go. Connect with us on http://twitter.com/NativeScript.
+ nativescript@3.3.1
added 692 packages in 156.18s
jsmbp:~ Js$ tns doctor
-bash: tns: command not found
我该怎么做才能解决这个问题?每次我卸载后尝试重新安装时,npm 也会声明 "rollbackFailedOptional"。 npm 是否缓存了一个损坏的版本,我可以强制它做一个真正的 "reinstall?" 它是如此令人沮丧,因为一切看起来都乱七八糟,我真的不想放弃 NS。告诉我您的想法,谢谢!
首先正确安装 node.js。我有你要你 --unsafe-perm
这意味着 node.js 安装没有正确完成。
我建议您使用自制软件安装 nvm
,然后从中安装节点。请参考我的解决方案posthttps://discourse.nativescript.org/t/not-installing-on-macos/3292/4
我真的需要别人的帮助,因为我已经解决这个问题很长时间了,但没有任何补救措施。
问题只是将 NativeScript CLI 安装到我的 OSX Yosemite Mac 上。我按照 NS 网站的步骤进行操作(安装正确的 Node.JS 版本,下载 Xcode 7.2(由于 OS 限制),安装 JSDK,安装 NS Sidekick,安装 Android Studio w/适当的 SDK 以及所有其他必需的依赖项。
但是,当我 运行 "sudo npm i -g nativescript --unsafe-perm" (否则它会抛出 EACCES 错误)时,我得到以下日志,说我缺少所有这些我知道的依赖项,但它是声称我没有。
最大的问题是,虽然它仍然会说 NativeScript 已成功安装,但每当我 运行 任何 tns 命令(如 tns doctor)时,都找不到 bash 命令。
我已确保遵循将 NS 添加到我的路径以及我的 Android 和 Java SDK 的说明。这是完整的日志:
jsmbp:~ Js$ sudo npm i -g nativescript --unsafe-perm
Password:
/Users/Jmsquillaro/.npm-packages/bin/nativescript -> /Users/Jmsquillaro/.npm-packages/lib/node_modules/nativescript/bin/tns
/Users/Jmsquillaro/.npm-packages/bin/tns -> /Users/Jmsquillaro/.npm-packages/lib/node_modules/nativescript/bin/tns
> fsevents@1.1.2 install /Users/Jmsquillaro/.npm-packages/lib/node_modules/nativescript/node_modules/fsevents
> node install
[fsevents] Success: "/Users/Jmsquillaro/.npm-packages/lib/node_modules/nativescript/node_modules/fsevents/lib/binding/Release/node-v48-darwin-x64/fse.node" already installed
Pass --update-binary to reinstall or --build-from-source to recompile
> nativescript@3.3.1 postinstall /Users/Jmsquillaro/.npm-packages/lib/node_modules/nativescript
> node postinstall.js
WARNING: adb from the Android SDK is not installed or is not configured properly.
For Android-related operations, the NativeScript CLI will use a built-in version of adb.
To avoid possible issues with the native Android emulator, Genymotion or connected
Android devices, verify that you have installed the latest Android SDK and
its dependencies as described in http://developer.android.com/sdk/index.html#Requirements
TIP: To avoid setting up the necessary environment variables, you can use the Homebrew package manager to install the Android SDK and its dependencies.
WARNING: The Android SDK is not installed or is not configured properly.
You will not be able to build your projects for Android and run them in the native emulator.
To be able to build for Android and run apps in the native emulator, verify that you have
installed the latest Android SDK and its dependencies as described in http://developer.android.com/sdk/index.html#Requirements
TIP: To avoid setting up the necessary environment variables, you can use the Homebrew package manager to install the Android SDK and its dependencies.
WARNING: CocoaPods is not installed or is not configured properly.
You will not be able to build your projects for iOS if they contain plugin with CocoaPod file.
To be able to build such projects, verify that you have installed CocoaPods.
The ANDROID_HOME environment variable is not set or it points to a non-existent directory. You will not be able to perform any build-related operations for Android.
To be able to perform Android build-related operations, set the ANDROID_HOME variable to point to the root of your Android SDK installation directory.
Cannot find a compatible Android SDK for compilation. To be able to build for Android, install Android SDK 22 or later.
Run $ sdkmanager to manage your Android SDK versions.
You need to have the Android SDK Build-tools installed on your system. You can install any version in the following range: '>=23 <=26'.
Run $ sdkmanager from your command-line to install required Android Build Tools. In case you already have them installed, make sure ANDROID_HOME environment variable is set correctly.
You need to have Android SDK 22 or later and the latest Android Support Repository installed on your system.
Run $ sdkmanager to manage the Android Support Repository. In case you already have it installed, make sure ANDROID_HOME environment variable is set correctly.
Error executing command 'javac'. Make sure you have installed The Java Development Kit (JDK) and set JAVA_HOME environment variable.
You will not be able to build your projects for Android.
To be able to build for Android, verify that you have installed The Java Development Kit (JDK) and configured it according to system requirements as
described in http://docs.nativescript.org/setup/ns-cli-setup/ns-setup-os-x.html#system-requirements
There seem to be issues with your configuration.
? Do you want to visit the official documentation? No
? Do you want to run the setup script? No
Your components are up-to-date:
nativescript,tns-core-modules,tns-android,tns-ios
Autocompletion is already enabled
Installation successful. You are good to go. Connect with us on http://twitter.com/NativeScript.
+ nativescript@3.3.1
added 692 packages in 156.18s
jsmbp:~ Js$ tns doctor
-bash: tns: command not found
我该怎么做才能解决这个问题?每次我卸载后尝试重新安装时,npm 也会声明 "rollbackFailedOptional"。 npm 是否缓存了一个损坏的版本,我可以强制它做一个真正的 "reinstall?" 它是如此令人沮丧,因为一切看起来都乱七八糟,我真的不想放弃 NS。告诉我您的想法,谢谢!
首先正确安装 node.js。我有你要你 --unsafe-perm
这意味着 node.js 安装没有正确完成。
我建议您使用自制软件安装 nvm
,然后从中安装节点。请参考我的解决方案posthttps://discourse.nativescript.org/t/not-installing-on-macos/3292/4