diff --git a/.circleci/dynamic_config.yml b/.circleci/dynamic_config.yml index 0eda0235edd9..46b8a56a22ba 100644 --- a/.circleci/dynamic_config.yml +++ b/.circleci/dynamic_config.yml @@ -24,7 +24,7 @@ parameters: # Windows needs its own cache key because binaries in node_modules are different. # See https://circleci.com/docs/2.0/caching/#restoring-cache for how prefixes work in CircleCI. var_1: &cache_key v1-angular_devkit-14.20-{{ checksum "yarn.lock" }} -var_1_win: &cache_key_win v1-angular_devkit-win-16.10-{{ checksum "yarn.lock" }} +var_1_win: &cache_key_win v1-angular_devkit-win-16.13-{{ checksum "yarn.lock" }} var_3: &default_nodeversion '14.20' var_3_major: &default_nodeversion_major '14' # The major version of node toolchains. See tools/toolchain_info.bzl @@ -114,8 +114,8 @@ commands: setup_windows: steps: - initialize_env - - run: nvm install 16.10 - - run: nvm use 16.10 + - run: nvm install 16.13 + - run: nvm use 16.13 - run: npm install -g yarn@1.22.10 - run: node --version - run: yarn --version @@ -421,7 +421,7 @@ workflows: matrix: alias: e2e-cli parameters: - nodeversion: ['14.20', '16.10'] + nodeversion: ['14.20', '16.13', '18.10'] subset: *all_e2e_subsets requires: - build @@ -429,7 +429,7 @@ workflows: - e2e-tests: name: e2e-snapshots-<< matrix.subset >> - nodeversion: '16.10' + nodeversion: '16.13' matrix: parameters: subset: *all_e2e_subsets diff --git a/constants.bzl b/constants.bzl index 684c0d92a47c..9f47a5f3c13c 100644 --- a/constants.bzl +++ b/constants.bzl @@ -1,5 +1,5 @@ # Engine versions to stamp in a release package.json -RELEASE_ENGINES_NODE = "^14.20.0 || >=16.10.0" +RELEASE_ENGINES_NODE = "^14.20.0 || ^16.13.0 || >=18.10.0" RELEASE_ENGINES_NPM = "^6.11.0 || ^7.5.6 || >=8.0.0" RELEASE_ENGINES_YARN = ">= 1.13.0" diff --git a/docs/DEVELOPER.md b/docs/DEVELOPER.md index bc4cc1477b34..cc06b685550c 100644 --- a/docs/DEVELOPER.md +++ b/docs/DEVELOPER.md @@ -6,7 +6,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 `v14.20`, or `v16.10` installed. See instructions [here](https://nodejs.org/en/download/). +1. Make sure that you have Node `v14.20`, `v16.13` or `v18.10` 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. diff --git a/lib/packages.ts b/lib/packages.ts index 01a85e4ff6a2..7b7f534970b4 100644 --- a/lib/packages.ts +++ b/lib/packages.ts @@ -85,7 +85,7 @@ function loadPackageJson(p: string) { // Overwrite engines to a common default. case 'engines': pkg['engines'] = { - 'node': '^14.20.0 || >=16.10.0', + 'node': '^14.20.0 || ^16.13.0 || >=18.10.0', 'npm': '^6.11.0 || ^7.5.6 || >=8.0.0', 'yarn': '>= 1.13.0', }; diff --git a/package.json b/package.json index d30bfa189a1d..8ac1e3200bef 100644 --- a/package.json +++ b/package.json @@ -41,7 +41,7 @@ "url": "https://github.com/angular/angular-cli.git" }, "engines": { - "node": "^14.20.0 || ^16.10.0", + "node": "^14.20.0 || ^16.13.0 || ^18.10.0", "yarn": ">=1.21.1 <2", "npm": "Please use yarn instead of NPM to install dependencies" }, diff --git a/packages/angular/cli/bin/ng.js b/packages/angular/cli/bin/ng.js index 5399becd99d9..b540e4bcf93f 100755 --- a/packages/angular/cli/bin/ng.js +++ b/packages/angular/cli/bin/ng.js @@ -24,7 +24,7 @@ try { // These may not support ES2015 features such as const/let/async/await/etc. // These would then crash with a hard to diagnose error message. var version = process.versions.node.split('.').map((part) => Number(part)); -if (version[0] % 2 === 1 && version[0] > 16) { +if (version[0] % 2 === 1) { // Allow new odd numbered releases with a warning (currently v17+) console.warn( 'Node.js version ' + @@ -37,16 +37,16 @@ if (version[0] % 2 === 1 && version[0] > 16) { require('./bootstrap'); } else if ( version[0] < 14 || - version[0] === 15 || - (version[0] === 14 && version[1] < 15) || - (version[0] === 16 && version[1] < 10) + (version[0] === 14 && version[1] < 20) || + (version[0] === 16 && version[1] < 13) || + (version[0] === 18 && version[1] < 10) ) { - // Error and exit if less than 14.20 or 15.x or less than 16.10 + // Error and exit if less than 14.20, 16.13 or 18.10 console.error( 'Node.js version ' + process.version + ' detected.\n' + - 'The Angular CLI requires a minimum Node.js version of either v14.20, or v16.10.\n\n' + + 'The Angular CLI requires a minimum Node.js version of either v14.20, v16.13 or v18.10.\n\n' + 'Please update your Node.js version or visit https://nodejs.org/ for additional instructions.\n', ); diff --git a/packages/angular/cli/src/commands/version/cli.ts b/packages/angular/cli/src/commands/version/cli.ts index 46c882ed6fa6..863b9e2102f4 100644 --- a/packages/angular/cli/src/commands/version/cli.ts +++ b/packages/angular/cli/src/commands/version/cli.ts @@ -22,7 +22,7 @@ interface PartialPackageInfo { /** * Major versions of Node.js that are officially supported by Angular. */ -const SUPPORTED_NODE_MAJORS = [14, 16]; +const SUPPORTED_NODE_MAJORS = [14, 16, 18]; const PACKAGE_PATTERNS = [ /^@angular\/.*/, @@ -118,7 +118,7 @@ export class VersionCommandModule extends CommandModule implements CommandModule ` Angular CLI: ${ngCliVersion} Node: ${process.versions.node}${unsupportedNodeVersion ? ' (Unsupported)' : ''} - Package Manager: ${packageManager.name} ${packageManager.version ?? ''} + Package Manager: ${packageManager.name} ${packageManager.version ?? ''} OS: ${process.platform} ${process.arch} Angular: ${angularCoreVersion} diff --git a/tools/test/expected_package.json b/tools/test/expected_package.json index cccb2ed63ac2..52e6f6e1ca50 100644 --- a/tools/test/expected_package.json +++ b/tools/test/expected_package.json @@ -35,7 +35,7 @@ } }, "engines": { - "node": "^14.20.0 || >=16.10.0", + "node": "^14.20.0 || ^16.13.0 || >=18.10.0", "npm": "^6.11.0 || ^7.5.6 || >=8.0.0", "yarn": ">= 1.13.0" }