Skip to content

Commit

Permalink
fix(core): ensure pnpm v7 install when peer deps are missing (#10522)
Browse files Browse the repository at this point in the history
  • Loading branch information
meeroslav committed May 30, 2022
1 parent b5cb620 commit daa5cfe
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion e2e/utils/index.ts
Expand Up @@ -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'
);
}

Expand Down
11 changes: 11 additions & 0 deletions packages/workspace/src/generators/workspace/workspace.ts
Expand Up @@ -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,
Expand Down Expand Up @@ -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);
Expand Down

1 comment on commit daa5cfe

@vercel
Copy link

@vercel vercel bot commented on daa5cfe May 30, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

nx-dev – ./

nx-five.vercel.app
nx-dev-git-master-nrwl.vercel.app
nx-dev-nrwl.vercel.app
nx.dev

Please sign in to comment.