Skip to content

Commit

Permalink
fix(link): don't update version specs in package.json
Browse files Browse the repository at this point in the history
close #4341
  • Loading branch information
zkochan committed May 7, 2023
1 parent 3f85e75 commit 0b4c140
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
6 changes: 6 additions & 0 deletions .changeset/angry-bobcats-develop.md
@@ -0,0 +1,6 @@
---
"@pnpm/plugin-commands-installation": patch
"pnpm": patch
---

`pnpm link -g <pkg-name>` should not modify the `package.json` file [#4341](https://github.com/pnpm/pnpm/issues/4341).
4 changes: 3 additions & 1 deletion pkg-manager/plugin-commands-installation/src/link.ts
Expand Up @@ -200,7 +200,9 @@ export async function handler (
storeDir: storeL.dir,
manifest,
} as LinkFunctionOptions)
await writeProjectManifest(newManifest)
if (!opts.cliOptions?.global) {
await writeProjectManifest(newManifest)
}

await Promise.all(
Array.from(storeControllerCache.values())
Expand Down

0 comments on commit 0b4c140

Please sign in to comment.