Skip to content

Dependency issue with 13.1.0 #22333

@phristov

Description

@phristov

🐞 Bug report

Can you pin-point the command or commands that are effected by this bug?

  • [x ] new

Did this behavior use to work in the previous version?
Yes
Yes, the previous version in which this bug was not present was: 13.0.0

Description

After I run ng new, npm is returning errors.

🔬 Minimal Reproduction

Angular CLI: 13.1.0
Node: 16.13.1
Package Manager: npm 8.1.2
OS: win32 x64

Angular:
...

Package                      Version
------------------------------------------------------
@angular-devkit/architect    0.1301.0 (cli-only)
@angular-devkit/core         13.1.0 (cli-only)
@angular-devkit/schematics   13.1.0 (cli-only)
@schematics/angular          13.1.0 (cli-only)
npm install -g @angular/cli
ng new t1we

Log

? Would you like to add Angular routing? Yes
? Which stylesheet format would you like to use? SCSS   [ https://sass-lang.com/documentation/syntax#scss                ]
CREATE t1we/angular.json (3195 bytes)
CREATE t1we/package.json (1068 bytes)
CREATE t1we/README.md (1050 bytes)
CREATE t1we/tsconfig.json (863 bytes)
CREATE t1we/.editorconfig (274 bytes)
CREATE t1we/.gitignore (620 bytes)
CREATE t1we/.browserslistrc (600 bytes)
CREATE t1we/karma.conf.js (1421 bytes)
CREATE t1we/tsconfig.app.json (287 bytes)
CREATE t1we/tsconfig.spec.json (333 bytes)
CREATE t1we/.vscode/extensions.json (130 bytes)
CREATE t1we/.vscode/launch.json (474 bytes)
CREATE t1we/.vscode/tasks.json (938 bytes)
CREATE t1we/src/favicon.ico (948 bytes)
CREATE t1we/src/index.html (290 bytes)
CREATE t1we/src/main.ts (372 bytes)
CREATE t1we/src/polyfills.ts (2338 bytes)
CREATE t1we/src/styles.scss (80 bytes)
CREATE t1we/src/test.ts (745 bytes)
CREATE t1we/src/assets/.gitkeep (0 bytes)
CREATE t1we/src/environments/environment.prod.ts (51 bytes)
CREATE t1we/src/environments/environment.ts (658 bytes)
CREATE t1we/src/app/app-routing.module.ts (245 bytes)
CREATE t1we/src/app/app.module.ts (393 bytes)
CREATE t1we/src/app/app.component.html (23364 bytes)
CREATE t1we/src/app/app.component.spec.ts (1067 bytes)
CREATE t1we/src/app/app.component.ts (209 bytes)
CREATE t1we/src/app/app.component.scss (0 bytes)
⠹ Installing packages (npm)...npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: t1we@0.0.0
npm ERR! Found: typescript@4.5.3
npm ERR! node_modules/typescript
npm ERR!   dev typescript@"~4.5.2" from the root project
npm ERR!   peer typescript@">=4.4.3 <4.6" from @angular-devkit/build-angular@13.1.0
npm ERR!   node_modules/@angular-devkit/build-angular
npm ERR!     dev @angular-devkit/build-angular@"~13.1.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer typescript@">=4.4.2 <4.5" from @angular/compiler-cli@13.0.3
npm ERR! node_modules/@angular/compiler-cli
npm ERR!   dev @angular/compiler-cli@"~13.0.0" from the root project
npm ERR!   peer @angular/compiler-cli@"^13.0.0 || ^13.1.0-next" from @angular-devkit/build-angular@13.1.0
npm ERR!   node_modules/@angular-devkit/build-angular
npm ERR!     dev @angular-devkit/build-angular@"~13.1.0" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR! See C:\Users\x\AppData\Local\npm-cache\eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\x\AppData\Local\npm-cache\_logs\2021-12-10T07_17_11_880Z-debug.log
✖ Package install failed, see above.
The Schematic workflow failed. See above.

Report

# npm resolution error report

2021-12-10T07:17:51.863Z

While resolving: t1weqwe@0.0.0
Found: typescript@4.5.3
node_modules/typescript
  dev typescript@"~4.5.2" from the root project
  peer typescript@">=4.4.3 <4.6" from @angular-devkit/build-angular@13.1.0
  node_modules/@angular-devkit/build-angular
    dev @angular-devkit/build-angular@"~13.1.0" from the root project

Could not resolve dependency:
peer typescript@">=4.4.2 <4.5" from @angular/compiler-cli@13.0.3
node_modules/@angular/compiler-cli
  dev @angular/compiler-cli@"~13.0.0" from the root project
  peer @angular/compiler-cli@"^13.0.0 || ^13.1.0-next" from @angular-devkit/build-angular@13.1.0
  node_modules/@angular-devkit/build-angular
    dev @angular-devkit/build-angular@"~13.1.0" from the root project

Fix the upstream dependency conflict, or retry
this command with --force, or --legacy-peer-deps
to accept an incorrect (and potentially broken) dependency resolution.

Raw JSON explanation object:

{
  "code": "ERESOLVE",
  "current": {
    "name": "typescript",
    "version": "4.5.3",
    "whileInstalling": {
      "name": "t1weqwe",
      "version": "0.0.0",
      "path": "D:\\projects\\t1weqwe"
    },
    "location": "node_modules/typescript",
    "isWorkspace": false,
    "dependents": [
      {
        "type": "dev",
        "name": "typescript",
        "spec": "~4.5.2",
        "from": {
          "location": "D:\\projects\\t1weqwe"
        }
      },
      {
        "type": "peer",
        "name": "typescript",
        "spec": ">=4.4.3 <4.6",
        "from": {
          "name": "@angular-devkit/build-angular",
          "version": "13.1.0",
          "whileInstalling": {
            "name": "t1weqwe",
            "version": "0.0.0",
            "path": "D:\\projects\\t1weqwe"
          },
          "location": "node_modules/@angular-devkit/build-angular",
          "isWorkspace": false,
          "dependents": [
            {
              "type": "dev",
              "name": "@angular-devkit/build-angular",
              "spec": "~13.1.0",
              "from": {
                "location": "D:\\projects\\t1weqwe"
              }
            }
          ]
        }
      }
    ]
  },
  "currentEdge": {
    "type": "dev",
    "name": "typescript",
    "spec": "~4.5.2",
    "from": {
      "location": "D:\\projects\\t1weqwe"
    }
  },
  "edge": {
    "type": "peer",
    "name": "typescript",
    "spec": ">=4.4.2 <4.5",
    "error": "INVALID",
    "from": {
      "name": "@angular/compiler-cli",
      "version": "13.0.3",
      "whileInstalling": {
        "name": "t1weqwe",
        "version": "0.0.0",
        "path": "D:\\projects\\t1weqwe"
      },
      "location": "node_modules/@angular/compiler-cli",
      "isWorkspace": false,
      "dependents": [
        {
          "type": "dev",
          "name": "@angular/compiler-cli",
          "spec": "~13.0.0",
          "from": {
            "location": "D:\\projects\\t1weqwe"
          }
        },
        {
          "type": "peer",
          "name": "@angular/compiler-cli",
          "spec": "^13.0.0 || ^13.1.0-next",
          "from": {
            "name": "@angular-devkit/build-angular",
            "version": "13.1.0",
            "whileInstalling": {
              "name": "t1weqwe",
              "version": "0.0.0",
              "path": "D:\\projects\\t1weqwe"
            },
            "location": "node_modules/@angular-devkit/build-angular",
            "isWorkspace": false,
            "dependents": [
              {
                "type": "dev",
                "name": "@angular-devkit/build-angular",
                "spec": "~13.1.0",
                "from": {
                  "location": "D:\\projects\\t1weqwe"
                }
              }
            ]
          }
        }
      ]
    }
  },
  "strictPeerDeps": false,
  "force": false
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions