@angular/cli 9.1.13 → 9.1.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/commands/add-impl.js
CHANGED
|
@@ -33,6 +33,7 @@ class AddCommand extends schematic_command_1.SchematicCommand {
|
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
35
|
async run(options) {
|
|
36
|
+
await package_manager_1.ensureCompatibleNpm(this.workspace.root);
|
|
36
37
|
if (!options.collection) {
|
|
37
38
|
this.logger.fatal(`The "ng add" command requires a name argument to be specified eg. ` +
|
|
38
39
|
`${color_1.colors.yellow('ng add [name] ')}. For more details, use "ng help".`);
|
package/commands/new-impl.js
CHANGED
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
*/
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
10
|
const schematic_command_1 = require("../models/schematic-command");
|
|
11
|
+
const package_manager_1 = require("../utilities/package-manager");
|
|
11
12
|
class NewCommand extends schematic_command_1.SchematicCommand {
|
|
12
13
|
constructor() {
|
|
13
14
|
super(...arguments);
|
|
@@ -19,6 +20,7 @@ class NewCommand extends schematic_command_1.SchematicCommand {
|
|
|
19
20
|
return super.initialize(options);
|
|
20
21
|
}
|
|
21
22
|
async run(options) {
|
|
23
|
+
await package_manager_1.ensureCompatibleNpm(this.workspace.root);
|
|
22
24
|
// Register the version of the CLI in the registry.
|
|
23
25
|
const packageJson = require('../package.json');
|
|
24
26
|
const version = packageJson.version;
|
package/commands/update-impl.js
CHANGED
|
@@ -184,6 +184,7 @@ class UpdateCommand extends command_1.Command {
|
|
|
184
184
|
}
|
|
185
185
|
// tslint:disable-next-line:no-big-function
|
|
186
186
|
async run(options) {
|
|
187
|
+
await package_manager_1.ensureCompatibleNpm(this.workspace.root);
|
|
187
188
|
// Check if the @angular-devkit/schematics package can be resolved from the workspace root
|
|
188
189
|
// This works around issues with packages containing migrations that cannot directly depend on the package
|
|
189
190
|
// This check can be removed once the schematic runtime handles this situation
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@angular/cli",
|
|
3
|
-
"version": "9.1.
|
|
3
|
+
"version": "9.1.14",
|
|
4
4
|
"description": "CLI tool for Angular",
|
|
5
5
|
"main": "lib/cli/index.js",
|
|
6
6
|
"bin": {
|
|
@@ -28,11 +28,11 @@
|
|
|
28
28
|
},
|
|
29
29
|
"homepage": "https://github.com/angular/angular-cli",
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@angular-devkit/architect": "0.901.
|
|
32
|
-
"@angular-devkit/core": "9.1.
|
|
33
|
-
"@angular-devkit/schematics": "9.1.
|
|
34
|
-
"@schematics/angular": "9.1.
|
|
35
|
-
"@schematics/update": "0.901.
|
|
31
|
+
"@angular-devkit/architect": "0.901.14",
|
|
32
|
+
"@angular-devkit/core": "9.1.14",
|
|
33
|
+
"@angular-devkit/schematics": "9.1.14",
|
|
34
|
+
"@schematics/angular": "9.1.14",
|
|
35
|
+
"@schematics/update": "0.901.14",
|
|
36
36
|
"@yarnpkg/lockfile": "1.1.0",
|
|
37
37
|
"ansi-colors": "4.1.1",
|
|
38
38
|
"debug": "4.1.1",
|
|
@@ -52,17 +52,17 @@
|
|
|
52
52
|
"ng-update": {
|
|
53
53
|
"migrations": "@schematics/angular/migrations/migration-collection.json",
|
|
54
54
|
"packageGroup": {
|
|
55
|
-
"@angular/cli": "9.1.
|
|
56
|
-
"@angular-devkit/build-angular": "0.901.
|
|
57
|
-
"@angular-devkit/build-ng-packagr": "0.901.
|
|
58
|
-
"@angular-devkit/build-webpack": "0.901.
|
|
59
|
-
"@angular-devkit/core": "9.1.
|
|
60
|
-
"@angular-devkit/schematics": "9.1.
|
|
55
|
+
"@angular/cli": "9.1.14",
|
|
56
|
+
"@angular-devkit/build-angular": "0.901.14",
|
|
57
|
+
"@angular-devkit/build-ng-packagr": "0.901.14",
|
|
58
|
+
"@angular-devkit/build-webpack": "0.901.14",
|
|
59
|
+
"@angular-devkit/core": "9.1.14",
|
|
60
|
+
"@angular-devkit/schematics": "9.1.14"
|
|
61
61
|
}
|
|
62
62
|
},
|
|
63
63
|
"engines": {
|
|
64
64
|
"node": ">= 10.13.0",
|
|
65
|
-
"npm": "
|
|
65
|
+
"npm": "^6.11.0",
|
|
66
66
|
"yarn": ">= 1.13.0"
|
|
67
67
|
},
|
|
68
68
|
"husky": {
|
|
@@ -2,3 +2,7 @@ import { PackageManager } from '../lib/config/schema';
|
|
|
2
2
|
export declare function supportsYarn(): boolean;
|
|
3
3
|
export declare function supportsNpm(): boolean;
|
|
4
4
|
export declare function getPackageManager(root: string): Promise<PackageManager>;
|
|
5
|
+
/**
|
|
6
|
+
* Checks if the npm version is version 6.x. If not, display a message and exit.
|
|
7
|
+
*/
|
|
8
|
+
export declare function ensureCompatibleNpm(root: string): Promise<void>;
|
|
@@ -55,3 +55,28 @@ async function getPackageManager(root) {
|
|
|
55
55
|
return packageManager || schema_1.PackageManager.Npm;
|
|
56
56
|
}
|
|
57
57
|
exports.getPackageManager = getPackageManager;
|
|
58
|
+
/**
|
|
59
|
+
* Checks if the npm version is version 6.x. If not, display a message and exit.
|
|
60
|
+
*/
|
|
61
|
+
async function ensureCompatibleNpm(root) {
|
|
62
|
+
var _a;
|
|
63
|
+
if ((await getPackageManager(root)) !== schema_1.PackageManager.Npm) {
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
try {
|
|
67
|
+
const version = child_process_1.execSync('npm --version', { encoding: 'utf8', stdio: 'pipe' }).trim();
|
|
68
|
+
const major = Number((_a = version.match(/^(\d+)\./)) === null || _a === void 0 ? void 0 : _a[1]);
|
|
69
|
+
if (major === 6) {
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
// tslint:disable-next-line: no-console
|
|
73
|
+
console.error(`npm version ${version} detected.\n` +
|
|
74
|
+
'The Angular CLI currently requires npm version 6.\n\n' +
|
|
75
|
+
'Please install a compatible version to proceed (`npm install --global npm@6`).\n');
|
|
76
|
+
process.exit(3);
|
|
77
|
+
}
|
|
78
|
+
catch (_b) {
|
|
79
|
+
// npm is not installed
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
exports.ensureCompatibleNpm = ensureCompatibleNpm;
|