Skip to content

Commit 453ed74

Browse files
clydinhansl
authored andcommitted
fix(@angular/cli): use configured package manager
1 parent 169ffa2 commit 453ed74

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

packages/@angular/cli/commands/new.ts

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ export default class NewCommand extends SchematicCommand {
99
'Creates a new directory and a new Angular app.';
1010
public static aliases = ['n'];
1111
public scope = CommandScope.outsideProject;
12+
public readonly allowMissingWorkspace = true;
1213
public arguments: string[] = [];
1314
public options: Option[] = [
1415
...this.coreOptions,

packages/@angular/cli/models/schematic-command.ts

+10-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { NodeJsSyncHost } from '@angular-devkit/core/node';
44
import { ArgumentStrategy, Command, Option } from './command';
55
import { NodeWorkflow } from '@angular-devkit/schematics/tools';
66
import { DryRunEvent, UnsuccessfulWorkflowExecution } from '@angular-devkit/schematics';
7+
import { getPackageManager } from '../utilities/config';
78
import { getCollection, getSchematic } from '../utilities/schematics';
89
import { take } from 'rxjs/operators';
910
import { WorkspaceLoader } from '../models/workspace-loader';
@@ -83,7 +84,15 @@ export abstract class SchematicCommand extends Command {
8384
let nothingDone = true;
8485
const loggingQueue: string[] = [];
8586
const fsHost = new virtualFs.ScopedHost(new NodeJsSyncHost(), normalize(this.project.root));
86-
const workflow = new NodeWorkflow(fsHost, { force, dryRun });
87+
const workflow = new NodeWorkflow(
88+
fsHost,
89+
{
90+
force,
91+
dryRun,
92+
packageManager: getPackageManager(),
93+
root: normalize(this.project.root),
94+
},
95+
);
8796

8897
const cwd = process.env.PWD;
8998
const workingDir = cwd.replace(this.project.root, '').replace(/\\/g, '/');

0 commit comments

Comments
 (0)