37

I am reinstalling my MacBook. And I receive the following message when I install (npm install -g @angular/cli) angular. Any idea why? I suspect the nom version but I comes along with node...

Developments npm install -g @angular/cli
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: '@angular/cli@11.1.4',
npm WARN EBADENGINE   required: { node: '>= 10.13.0', npm: '^6.11.0', yarn: '>= 1.13.0' },
npm WARN EBADENGINE   current: { node: 'v15.8.0', npm: '7.5.2' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: '@angular-devkit/architect@0.1101.4',
npm WARN EBADENGINE   required: { node: '>= 10.13.0', npm: '^6.11.0', yarn: '>= 1.13.0' },
npm WARN EBADENGINE   current: { node: 'v15.8.0', npm: '7.5.2' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: '@angular-devkit/core@11.1.4',
npm WARN EBADENGINE   required: { node: '>= 10.13.0', npm: '^6.11.0', yarn: '>= 1.13.0' },
npm WARN EBADENGINE   current: { node: 'v15.8.0', npm: '7.5.2' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: '@angular-devkit/schematics@11.1.4',
npm WARN EBADENGINE   required: { node: '>= 10.13.0', npm: '^6.11.0', yarn: '>= 1.13.0' },
npm WARN EBADENGINE   current: { node: 'v15.8.0', npm: '7.5.2' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: '@schematics/angular@11.1.4',
npm WARN EBADENGINE   required: { node: '>= 10.13.0', npm: '^6.11.0', yarn: '>= 1.13.0' },
npm WARN EBADENGINE   current: { node: 'v15.8.0', npm: '7.5.2' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: '@schematics/update@0.1101.4',
npm WARN EBADENGINE   required: { node: '>= 10.13.0', npm: '^6.11.0', yarn: '>= 1.13.0' },
npm WARN EBADENGINE   current: { node: 'v15.8.0', npm: '7.5.2' }
npm WARN EBADENGINE }
npm WARN deprecated har-validator@5.1.5: this library is no longer supported
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142

    added 241 packages, and audited 242 packages in 12s
    
    20 packages are looking for funding
      run `npm fund` for details
    
    found 0 vulnerabilities
R. Richards
  • 24,603
  • 10
  • 64
  • 64
Jean-Philippe M
  • 731
  • 1
  • 7
  • 19

4 Answers4

30

Update - 25th Feb 2021

npm 7.5.6 or greater now works with angular-cli versions 9.1.15, 10.2.3, 11.2.2, 12.0.0-next.2 or greater (within each major version) as per this comment from the Angular team

Original Message - 7th Feb 2021

As of writing npm 7 is not fully supported by angular-cli as per this GitHub issue

I also get the same warnings on Windows with current: { node: 'v15.4.0', npm: '7.5.2' }

Angular CLI returns a warning when I run ng new with npm 7 and offers a workaround

npm version 7.5.2 detected.
The Angular CLI currently requires npm version 6.

Please install a compatible version to proceed (`npm install --global npm@6`).

npm 7 was made generally available very recently on 2nd Feb 2021

This an ongoing issue and the npm team have recently added a comment in response to the Angular team to the aforementioned GitHub issue.

connorads
  • 510
  • 1
  • 6
  • 12
  • 1
    So, should I downgrade the version of Node/Npm? – Jean-Philippe M Feb 07 '21 at 14:03
  • 1
    Don't think there is a need to downgrade node. If you need a workaround to use `ng` right now then you can follow the error message instructions and try downgrading npm to version 6 `npm install --global npm@6`. But you might want to subscribe to the [GitHub issue](https://github.com/angular/angular-cli/issues/19957) to see if there are any npm 7 compatible workarounds or fixes in the future. – connorads Feb 07 '21 at 14:09
  • Update: npm 7.5.6 should work with `angular-cli` in an upcoming release. The angular team has made a change to *"remove npm 7 incompatibility notification"* in this [PR](https://github.com/angular/angular-cli/pull/20132) which as of writing has been merged to `master` but not yet released. I will edit and update my answer once the new version of `angular-cli` has been released. – connorads Feb 24 '21 at 17:33
  • downgrade npm works for me . Use below command : npm install --global npm@6.14.16 – Devendra Singraul Feb 14 '22 at 12:33
6

I had the same problem. it's working with:

Upgrade the npm version

npm install -g npm@7.22.0

check the current version

Madbreaks
  • 19,094
  • 7
  • 58
  • 72
ibrahimgb
  • 693
  • 5
  • 13
  • I think the last version minor version of npm is [v7.24.2](https://github.com/npm/cli/releases) – Preston Oct 29 '21 at 16:22
  • yes I know, check the date that I posted it. the problem forced me to specify the update manually – ibrahimgb Oct 29 '21 at 17:09
  • the comment is for other people coming to this answer – Preston Oct 29 '21 at 17:12
  • Worked for me. Had following version error: npm WARN EBADENGINE Unsupported engine { npm WARN EBADENGINE package: '@angular-devkit/architect@0.1202.0', npm WARN EBADENGINE required: { npm WARN EBADENGINE node: '^12.14.1 || >=14.0.0', npm WARN EBADENGINE npm: '^6.11.0 || ^7.5.6', npm WARN EBADENGINE yarn: '>= 1.13.0' npm WARN EBADENGINE }, npm WARN EBADENGINE current: { node: 'v16.14.2', npm: '8.5.5' } – Brijesh Ray Apr 05 '22 at 16:18
5

This issue is because the npm version

npm WARN EBADENGINE required: { node: '>= 10.13.0', npm: '^6.11.0', yarn: '>= 1.13.0' }

  • node: '>= 10.13.0' angular cli requires a version greater or equal to 10.13.0
  • npm: '^6.11.0' here the caret (^) means "Compatible with version" 6.11 and you have a version 7.5.2

check this post to learn more about npm symbols like ^ or ~

all you have to do is install a compatible version

sudo npm i -g npm@6.11.0
Alan Mejia
  • 191
  • 1
  • 4
  • As was said above it's best not to use `sudo` as it can result in permission conflicts when doing updates and work in the future. – Levidps Apr 23 '21 at 02:36
0

In my case the upgrade to a newer angular-devkit fixed the issue.

Now im using: Angular 11.2.6 with npm 7.6.3

"devDependencies": {
        "@angular-devkit/build-angular": "^0.1102.5",
    ...
N33D
  • 135
  • 1
  • 7