Skip to content

pnpm run scripts doesn't use Node version specified in package.json #2072

@mb21

Description

@mb21

I'm on volta 2.0.2 on macOS 15.7.1

With this package.json:

{
  "name": "my-website",
  "scripts": {
    "start": "node --version"
  },
  "volta": {
    "node": "24.9.0"
  }
}
pnpm run start

prints v22.19.0 (the one from ~/.volta/tools/image/node/22.19.0/bin/node). The weird thing is, that's not even the default I set with volta install. No idea where it's getting that version from. What it worse, if I rm -r ~/.volta/tools/image/node/22.19.0/, running the script redownloads it!

npm run start correctly prints out v24.9.0.

My actual use-case is to have node ./src/index.js in there. Perhaps there's a workaround?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions