NativeScript / NativeScript/nativescript-cli

Build fails when devDependency version is specified indirectly

Open
#5,451 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.