Skip to content

Commit

Permalink
build: update minimum supported node.js version to 12.14
Browse files Browse the repository at this point in the history
This is to match the ranges in the framework repo.
  • Loading branch information
alan-agius4 committed Apr 27, 2021
1 parent 9d6c1da commit 0b27cfb
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ To get started locally, follow these instructions:

1. If you haven't done it already, [make a fork of this repo](https://github.com/angular/angular-cli/fork).
1. Clone to your local computer using `git`.
1. Make sure that you have Node 10.13 or later installed. See instructions [here](https://nodejs.org/en/download/).
1. Make sure that you have Node 12.14 or 14.0 installed. See instructions [here](https://nodejs.org/en/download/).
1. Make sure that you have `yarn` installed; see instructions [here](https://yarnpkg.com/lang/en/docs/install/).
1. Run `yarn` (no arguments) from the root of your clone of this project to install dependencies.

Expand Down
2 changes: 1 addition & 1 deletion lib/packages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ function loadPackageJson(p: string) {
// Overwrite engines to a common default.
case 'engines':
pkg['engines'] = {
'node': '>= 12.13.0',
'node': '^12.14.1 || ^14.0.0',
'npm': '^6.11.0 || ^7.5.6',
'yarn': '>= 1.13.0',
};
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"url": "https://github.com/angular/angular-cli.git"
},
"engines": {
"node": ">=12.13.0 <15.0.0",
"node": "^12.14.1 || ^14.0.0",
"yarn": ">=1.21.1 <2",
"npm": "Please use yarn instead of NPM to install dependencies"
},
Expand Down
6 changes: 3 additions & 3 deletions packages/angular/cli/bin/ng
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,15 @@ if (version[0] % 2 === 1 && version[0] > 14) {
} else if (
version[0] < 12 ||
version[0] === 13 ||
(version[0] === 12 && version[1] < 13) ||
(version[0] === 12 && version[1] < 14) ||
(version[0] === 14 && version[1] < 15)
) {
// Error and exit if less than 12.13 or 13.x or less than 14.15
// Error and exit if less than 12.14 or 13.x or less than 14.15
console.error(
'Node.js version ' +
process.version +
' detected.\n' +
'The Angular CLI requires a minimum Node.js version of either v12.13 or v14.15.\n\n' +
'The Angular CLI requires a minimum Node.js version of either v12.14 or v14.15.\n\n' +
'Please update your Node.js version or visit https://nodejs.org/ for additional instructions.\n',
);

Expand Down
4 changes: 2 additions & 2 deletions packages/angular/cli/lib/cli/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ const isDebug =
export default async function(options: { testing?: boolean; cliArgs: string[] }) {
// This node version check ensures that the requirements of the project instance of the CLI are met
const version = process.versions.node.split('.').map(part => Number(part));
if (version[0] < 10 || version[0] === 11 || (version[0] === 10 && version[1] < 13)) {
if (version[0] < 12 || (version[0] === 12 && version[1] < 14)) {
process.stderr.write(
`Node.js version ${process.version} detected.\n` +
'The Angular CLI requires a minimum Node.js version of either v10.13 or v12.0.\n\n' +
'The Angular CLI requires a minimum v12.14.\n\n' +
'Please update your Node.js version or visit https://nodejs.org/ for additional instructions.\n',
);

Expand Down
2 changes: 1 addition & 1 deletion scripts/templates/readme.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ To get started locally, follow these instructions:

1. If you haven't done it already, [make a fork of this repo](https://github.com/angular/angular-cli/fork).
1. Clone to your local computer using `git`.
1. Make sure that you have Node 10.13 or later installed. See instructions [here](https://nodejs.org/en/download/).
1. Make sure that you have Node 12.14 or 14.0 installed. See instructions [here](https://nodejs.org/en/download/).
1. Make sure that you have `yarn` installed; see instructions [here](https://yarnpkg.com/lang/en/docs/install/).
1. Run `yarn` (no arguments) from the root of your clone of this project to install dependencies.

Expand Down

0 comments on commit 0b27cfb

Please sign in to comment.