File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -33,17 +33,21 @@ let forceExit = false;
3333 * See: https://github.com/browserslist/browserslist/blob/819c4337456996d19db6ba953014579329e9c6e1/node.js#L324
3434 */
3535 process . env . BROWSERSLIST_IGNORE_OLD_DATA = '1' ;
36+ const rawCommandName = process . argv [ 2 ] ;
3637
3738 /**
3839 * Disable CLI version mismatch checks and forces usage of the invoked CLI
3940 * 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
4045 */
41- if ( disableVersionCheck ) {
46+ if ( disableVersionCheck || rawCommandName === 'new' ) {
4247 return ( await import ( './cli' ) ) . default ;
4348 }
4449
4550 let cli ;
46- const rawCommandName = process . argv [ 2 ] ;
4751
4852 try {
4953 // No error implies a projectLocalCli, which will load whatever
You can’t perform that action at this time.
0 commit comments