Is there an existing issue for this?
Current Behavior
npm x -q --yes --package=<package>@<version> -- <command> doesn't honor <version>, uses incompatible package that is locally available instead.
Expected Behavior
npm x -q --yes --package=<package>@<version> -- <command> honors <version>, does not uses incompatible package that is locally available instead.
Steps To Reproduce
- Write this
package.json:
{
"private": true,
"devDependencies": {
"pnpm": "=6.12.1"
}
}
- Run
npm i
[email protected] is now installed locally.
$ npm x -q --yes -- pnpm --version
6.12.1
- Run pnpm 6.13.0 now:
npm x won't honor the version
The docs for npm exec state:
Package names provided without a specifier will be matched with whatever version exists in the local project. Package names with a specifier will only be considered a match if they have the exact same name and version as the local dependency.
Environment
- OS: macOS 11.4
- Node: 16.5.0
- npm: 7.21.0
Is there an existing issue for this?
Current Behavior
npm x -q --yes --package=<package>@<version> -- <command>doesn't honor<version>, uses incompatible package that is locally available instead.Expected Behavior
npm x -q --yes --package=<package>@<version> -- <command>honors<version>, does not uses incompatible package that is locally available instead.Steps To Reproduce
package.json:{ "private": true, "devDependencies": { "pnpm": "=6.12.1" } }npm i[email protected]is now installed locally.npm xwon't honor the version$ npm x -q --yes --package="[email protected]" -- pnpm --version 6.12.1The docs for
npm execstate:Environment