Skip to content

Commit 21f2cf1

Browse files
JPeer264claude
andauthored
chore: Pin pnpm 10 in Volta and remove .npmrc (#25641)
This changes the Volta pnpm pin from 9.15.9 to 10.34.6 and removes the root `.npmrc`. Volta cannot start pnpm 11 or newer ([volta-cli/volta#2114](volta-cli/volta#2114)), and pnpm 10 switches to the `packageManager` version by default, so `manage-package-manager-versions=true` is not needed. `package.json` and `CONTRIBUTING.md` now explain the pin and that it needs `VOLTA_FEATURE_PNPM=1` in the shell profile. ## Why - `pnpm test --watch` failed locally with `Unknown option: 'watch'`, because pnpm 9 reads the options of its `test` command before it switches. - npm warned `Unknown project config "manage-package-manager-versions"` at every call in the repo. - Without `VOLTA_FEATURE_PNPM=1`, Volta ignores the pin, and the docs did not name the variable. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 40eff80 commit 21f2cf1

4 files changed

Lines changed: 9 additions & 7 deletions

File tree

‎.agents/skills/fix-security-vulnerability/scripts/classify-alerts.mjs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ function fetchOpenAlerts() {
6969
}
7070

7171
// Resolve a dependency's installed directory, preferring the consumer's nested node_modules and
72-
// falling back to the hoisted root node_modules (`node-linker=hoisted` in .npmrc hoists most deps to the root).
72+
// falling back to the hoisted root node_modules (`nodeLinker: hoisted` in pnpm-workspace.yaml hoists most deps to the root).
7373
function resolveDepDir(name, baseDir) {
7474
const candidates = [join(baseDir, 'node_modules', name), join(REPO_ROOT, 'node_modules', name)];
7575
return candidates.find(dir => existsSync(join(dir, 'package.json')));

‎.npmrc‎

Lines changed: 0 additions & 3 deletions
This file was deleted.

‎CONTRIBUTING.md‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,9 @@ Developer Documentation.
1414

1515
## Setting up an Environment
1616

17-
We use [Volta](https://volta.sh/) to ensure we use consistent versions of node and pnpm. Make sure to enable
18-
[pnpm support in Volta](https://docs.volta.sh/advanced/pnpm).
17+
We use [Volta](https://volta.sh/) to ensure we use consistent versions of node and pnpm. Volta manages pnpm only when
18+
[pnpm support](https://docs.volta.sh/advanced/pnpm) is enabled, so add `export VOLTA_FEATURE_PNPM=1` to your shell
19+
profile (for example `~/.zshrc`).
1920

2021
`sentry-javascript` is a monorepo containing several packages, managed with pnpm workspaces and Nx. To get started,
2122
install all dependencies, and then perform an initial build, so TypeScript can read all of the linked type definitions.

‎package.json‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,13 @@
4949
"yalc:publish": "nx run-many -t yalc:publish"
5050
},
5151
"packageManager": "pnpm@12.11.2",
52+
"//_volta_comment": [
53+
"Volta cannot start pnpm 11 or newer (volta-cli/volta#2114). It starts this pnpm 10 version, which switches to the `packageManager` version.",
54+
"Volta reads the pnpm version only when `VOLTA_FEATURE_PNPM=1` is set, see CONTRIBUTING.md."
55+
],
5256
"volta": {
5357
"node": "24.22.1",
54-
"pnpm": "9.15.9"
58+
"pnpm": "10.34.6"
5559
},
5660
"//_workspaces_comment": [
5761
"pnpm reads the workspace packages from pnpm-workspace.yaml. Deno and the repo scripts read this list.",

0 commit comments

Comments
 (0)