File tree 1 file changed +6
-2
lines changed
1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -33,17 +33,21 @@ let forceExit = false;
33
33
* See: https://github.com/browserslist/browserslist/blob/819c4337456996d19db6ba953014579329e9c6e1/node.js#L324
34
34
*/
35
35
process . env . BROWSERSLIST_IGNORE_OLD_DATA = '1' ;
36
+ const rawCommandName = process . argv [ 2 ] ;
36
37
37
38
/**
38
39
* Disable CLI version mismatch checks and forces usage of the invoked CLI
39
40
* instead of invoking the local installed version.
41
+ *
42
+ * When running `ng new` always favor the global version. As in some
43
+ * cases orphan `node_modules` would cause the non global CLI to be used.
44
+ * @see : https://github.com/angular/angular-cli/issues/14603
40
45
*/
41
- if ( disableVersionCheck ) {
46
+ if ( disableVersionCheck || rawCommandName === 'new' ) {
42
47
return ( await import ( './cli' ) ) . default ;
43
48
}
44
49
45
50
let cli ;
46
- const rawCommandName = process . argv [ 2 ] ;
47
51
48
52
try {
49
53
// No error implies a projectLocalCli, which will load whatever
You can’t perform that action at this time.
0 commit comments