diff --git a/e2e/utils/index.ts b/e2e/utils/index.ts index aa4160391776e..433533bc37fb1 100644 --- a/e2e/utils/index.ts +++ b/e2e/utils/index.ts @@ -298,7 +298,7 @@ export function newProject({ if (isCI && packageManager === 'pnpm') { updateFile( '.npmrc', - 'prefer-frozen-lockfile=false\nstrict-peer-dependencies=false' + 'prefer-frozen-lockfile=false\nstrict-peer-dependencies=false\nauto-install-peers=true' ); } diff --git a/packages/workspace/src/generators/workspace/workspace.ts b/packages/workspace/src/generators/workspace/workspace.ts index ff95f62aebf31..552f1ddd39a03 100644 --- a/packages/workspace/src/generators/workspace/workspace.ts +++ b/packages/workspace/src/generators/workspace/workspace.ts @@ -89,6 +89,14 @@ function createPrettierrc(host: Tree, options: Schema) { ); } +// ensure that pnpm install add all the missing peer deps +function createNpmrc(host: Tree, options: Schema) { + host.write( + join(options.directory, '.npmrc'), + 'strict-peer-dependencies=false\nauto-install-peers=true\n' + ); +} + function formatWorkspaceJson(host: Tree, options: Schema) { const path = join( options.directory, @@ -146,6 +154,9 @@ export async function workspaceGenerator(host: Tree, options: Schema) { if (options.cli === 'angular') { decorateAngularClI(host, options); } + if (options.packageManager === 'pnpm') { + createNpmrc(host, options); + } setPresetProperty(host, options); addNpmScripts(host, options); createAppsAndLibsFolders(host, options);