NativeScript / NativeScript/nativescript-cli
Build fails when devDependency version is specified indirectly
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 1.1k
- Forks
- 204
- Avg merge
- 1d 9h
- Merged PRs (30d)
- 8
Description
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):
✔ Component nativescript has 7.0.12 version and is up to date.
✔ Component @nativescript/core has 7.0.13 version and is up to date.
✔ Component @nativescript/ios has 7.0.6 version and is up to date.
✔ Component @nativescript/android has 7.0.1 version and is up to date.
- XCode Version: 12.3
Describe the bug
ns build android return error:
Invalid Version: file:../../node_modules/@nativescript/android
The error appears when version in package.json refers to @node_modules folder (does not contain exact string). Such setup is common for monorepo-style projects (for example, @nrwl/nx) - but monorepo is not mandatory, error happens when version is specified indirectly.
For example:
"@nativescript/android": "file:../../node_modules/@nativescript/android",
"@nativescript/ios": "file:../../node_modules/@nativescript/ios",
"@nativescript/webpack": "file:../../node_modules/@nativescript/webpack",
instead of
"@nativescript/android": "7.0.1",
"@nativescript/ios": "7.0.6",
"@nativescript/webpack": "3.0.8",
Expected behavior
Version resolved w/out errors.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by inspecting the package.json dependency entries shown in the issue and reproduce the failure with ns build android. Trace how the CLI resolves those indirect file: versions; done means the same dependencies resolve without the Invalid Version error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, ios, javascript
- Domain
- cli, mobile-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100