1

I'm trying to install nodejs version 10.x on macos, along with angular cli. But each time I try, I get errors about ng not being compatible with the version of node.

I've been following the post here Unable to get Angular CLI version, though all the requirements are installed?

I don't get any errors during install but i keep getting the error:

adminMini:client admin$ ng -v
Node.js version v10.24.1 detected.
The Angular CLI requires a minimum Node.js version of either v12.14 or v14.15.

Please update your Node.js version or visit https://nodejs.org/ for additional instructions.

This is how I installed angular:

adminMini:client admin$ nvm use 10
Now using node v10.24.1 (npm v6.14.12)

adminMini:client admin$ npm uninstall -g @angular/cli
removed 235 packages in 2.001s

adminMini:client admin$ nvm use 10
Now using node v10.24.1 (npm v6.14.12)
adminMini:client admin$ npm install -g @angular/cli
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated har-validator@5.1.5: this library is no longer supported
/Users/admin/.nvm/versions/node/v10.24.1/bin/ng -> /Users/admin/.nvm/versions/node/v10.24.1/lib/node_modules/@angular/cli/bin/ng

> @angular/cli@12.1.0 postinstall /Users/admin/.nvm/versions/node/v10.24.1/lib/node_modules/@angular/cli
> node ./bin/postinstall/script.js

npm WARN notsup Unsupported engine for @angular/cli@12.1.0: wanted: {"node":"^12.14.1 || >=14.0.0","npm":"^6.11.0 || ^7.5.6","yarn":">= 1.13.0"} (current: {"node":"10.24.1","npm":"6.14.12"})
npm WARN notsup Not compatible with your version of node/npm: @angular/cli@12.1.0
npm WARN notsup Unsupported engine for @angular-devkit/architect@0.1201.0: wanted: {"node":"^12.14.1 || >=14.0.0","npm":"^6.11.0 || ^7.5.6","yarn":">= 1.13.0"} (current: {"node":"10.24.1","npm":"6.14.12"})
npm WARN notsup Not compatible with your version of node/npm: @angular-devkit/architect@0.1201.0
npm WARN notsup Unsupported engine for @angular-devkit/core@12.1.0: wanted: {"node":"^12.14.1 || >=14.0.0","npm":"^6.11.0 || ^7.5.6","yarn":">= 1.13.0"} (current: {"node":"10.24.1","npm":"6.14.12"})
npm WARN notsup Not compatible with your version of node/npm: @angular-devkit/core@12.1.0
npm WARN notsup Unsupported engine for @angular-devkit/schematics@12.1.0: wanted: {"node":"^12.14.1 || >=14.0.0","npm":"^6.11.0 || ^7.5.6","yarn":">= 1.13.0"} (current: {"node":"10.24.1","npm":"6.14.12"})
npm WARN notsup Not compatible with your version of node/npm: @angular-devkit/schematics@12.1.0
npm WARN notsup Unsupported engine for @schematics/angular@12.1.0: wanted: {"node":"^12.14.1 || >=14.0.0","npm":"^6.11.0 || ^7.5.6","yarn":">= 1.13.0"} (current: {"node":"10.24.1","npm":"6.14.12"})
npm WARN notsup Not compatible with your version of node/npm: @schematics/angular@12.1.0
npm WARN notsup Unsupported engine for open@8.2.1: wanted: {"node":">=12"} (current: {"node":"10.24.1","npm":"6.14.12"})
npm WARN notsup Not compatible with your version of node/npm: open@8.2.1

+ @angular/cli@12.1.0
added 235 packages from 180 contributors in 7.702s

Any tips would be appreciated.

dot
  • 14,928
  • 41
  • 110
  • 218
  • Node.js 10.x is unsupported. Like, not just unsupported by Angular, but unsupported by the Node.js project. Update to 12.x, 14.x, or 16.x (which are the supported versions as of this writing). – Trott Jun 29 '21 at 16:04

2 Answers2

5

When using the command npm install -g @angular/cli you will install the latest version of angular and it requires the version 12 of node.

So you will need to update your node version to 12 or install a previous version of angular by indicating the verison to the install script

npm -g install @angular/cli@8.3.25
2

You are already using nvm, try installing node latest version using nvm like this:

nvm install --lts

Check the latest nvm version which should greater than 12. The reason is angular version 8 dependencies don't run well with lower version of node. And it is also recommended to keep the version updated for security vulnerability.

This will list the version, select the version v12.14 or v14.15 or LTS

nvm list
.....
nvm use v12.14

After this install the angular version 8+ using this link.

Apoorva Chikara
  • 8,277
  • 3
  • 20
  • 35