Build fails when devDependency version is specified indirectly

未关闭
#5,451 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
35/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
停滞
技术栈
android, ios, javascript
领域
cli, mobile-dev

调研方向

首先检查 issue 中显示的 package.json 依赖项,并使用 ns build android 重现失败。跟踪 CLI 如何解析这些间接的 file: 版本;当相同的依赖项能够在没有 Invalid Version 错误的情况下解析时,即表示完成。

由索引模型根据 Issue 内容生成。

描述

bug

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.

主要语言
JavaScript
星标
1.1k
派生
204
平均合并
1 天 9 小时
30 天内合并 PR
8

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

NativeScript/nativescript-cli 的其他 Issue

查看 NativeScript/nativescript-cli 的全部 Issue

相似的 Issue

更多 JavaScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。