Nativescript 运行“tns build android”时出现错误“spawn./gradlew enoint”`

Nativescript 运行“tns build android”时出现错误“spawn./gradlew enoint”`,nativescript,Nativescript,我从nativescript开始。我正在尝试构建一个hello world应用程序来测试它。然而,当我运行它时,我会得到命令NotFound的退出状态127 以下是我如何尝试构建: [ahmed@localhost hello]$ tns build android Executing before-shouldPrepare hook from /home/ahmed/PycharmProjects/hello/hooks/before-shouldPrepare/nativescript-d

我从nativescript开始。我正在尝试构建一个hello world应用程序来测试它。然而,当我运行它时,我会得到命令NotFound的退出状态127

以下是我如何尝试构建:

[ahmed@localhost hello]$ tns build android
Executing before-shouldPrepare hook from /home/ahmed/PycharmProjects/hello/hooks/before-shouldPrepare/nativescript-dev-webpack.js
Skipping prepare.
Building project...
Gradle build...
spawn ./gradlew ENOENT
[ahmed@localhost hello]$ echo $?
127
[ahmed@localhost hello]$ 
如果我运行
tns-doctor
,一切似乎都正常

[ahmed@localhost hello]$ 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.
✔ Local builds for iOS can be executed only on a macOS system. To build for iOS on a different operating system, you can use the NativeScript cloud infrastructure.
✔ Getting NativeScript components versions information...
✔ Component nativescript has 5.1.0 version and is up to date.
✔ Component tns-core-modules has 5.1.1 version and is up to date.
✔ Component tns-android has 5.1.0 version and is up to date.
✔ Component tns-ios has 5.1.0 version and is up to date.
[ahmed@localhost hello]$ 

我错过了什么?

我运行了
tns install
来安装依赖项。这解决了我的问题

我尝试了几件事,其中一件对我起作用的是:

  • ns-clean
  • ns安装