NativeScript / NativeScript/nativescript-cli
Error for invalid min runtime version in a plugin is misleading
還沒有人認領這個 Issue。
- 主要語言
- JavaScript
- 星號
- 1.1k
- 分支
- 204
- 平均合併
- 1 天 9 小時
- 30 天內合併 PR
- 8
描述
Environment
Provide version numbers for the following components (information can be retrieved by running tns info in your project folder or by inspecting the package.json of the project):
- CLI: 5.0.0-2018-10-08-12406
Describe the bug
When installing a plugin with wrong min runtime version (e.g. "next") the error that is thrown while building the app is misleading.
To Reproduce
- Clone the nativescript-ui-listview plugin repo
- Change the nativescript-android and ios versions in src/package.json file to next
- Pack the plugin with
sh pack.sh - Add the plugin to one of the demos (e.g. cd demo-angular && tns plugin add ../publish/package/*.tgz)
- Execute
tns run android
Preparing project...
Executing before-prepareJSApp hook from /Users/dtodorov/SSD/nativescript-ui-listview/demo-angular/hooks/before-prepareJSApp/nativescript-dev-webpack.js
Successfully prepared plugin nativescript-angular for android.
Successfully prepared plugin nativescript-fresco for android.
Successfully prepared plugin nativescript-theme-core for android.
Unable to apply changes on device: emulator-5554. Error is: Processing node_modules failed. TypeError: Invalid Version: next.
Building project...
Gradle build...
Project evaluation failed including an error in afterEvaluate {}. Run with --stacktrace for details of the afterEvaluate {} error.
FAILURE: Build failed with an exception.
* Where:
Build file '/Users/dtodorov/SSD/nativescript-ui-listview/demo-angular/platforms/android/app/build.gradle' line: 65
* What went wrong:
A problem occurred evaluating project ':app'.
>
'dependencies.json' file not found. Check whether the NativeScript CLI has prepared the project beforehand,
and that your NativeScript version is 3.3, or a more recent one. To build an android project with the current
version of the {N} CLI install a previous version of the runtime package - 'tns platform add android@3.2'.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 0s
Unable to apply changes on device: 01a5bd7074a39516. Error is: Command ./gradlew failed with exit code 1.
Expected behavior
The error should point what exactly is the issue, which are supported formats and shouldn't proceed with build.
貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
研究方向
按照列出的步驟重現此失敗,先從 src/package.json 中的版本值和 pack.sh workflow 開始,然後從 demo-angular 執行 tns run android。追蹤 CLI 在建置開始前處理外掛程式最低 runtime 版本的位置。完成標準是:諸如 "next" 之類的無效值會產生直接的驗證錯誤,列出支援的格式並停止建置。
由索引模型根據 Issue 內容生成。
評估
- 技術堆疊
- javascript
- 領域
- cli, mobile-dev
- Issue 類型
- 缺陷
- 難度
- 3/5
- 預估耗時
- 1-2 天
- 活躍度
- 停滯
- 描述清晰度
- 基本清楚
- 新手友好度
- 38/100