NativeScript / nativescript-cli

Command-line interface for building NativeScript apps
https://www.npmjs.com/package/nativescript
Apache License 2.0
1.04k stars 195 forks source link

Build fails when devDependency version is specified indirectly #5451

Open n0mer opened 3 years ago

n0mer commented 3 years ago

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.

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.

rigor789 commented 3 years ago

Same issue as https://github.com/NativeScript/nativescript-cli/issues/5444