Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] npm exec doesn't honor package version #3667

Closed
1 task done
Tracked by #403
jcayzac opened this issue Aug 20, 2021 · 2 comments
Closed
1 task done
Tracked by #403

[BUG] npm exec doesn't honor package version #3667

jcayzac opened this issue Aug 20, 2021 · 2 comments
Labels
Bug thing that needs fixing Needs Triage needs review for next steps Release 7.x work is associated with a specific npm 7 release

Comments

@jcayzac
Copy link

jcayzac commented Aug 20, 2021

Is there an existing issue for this?

  • I have searched the existing issues

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

  1. Write this package.json:
    {
      "private": true,
      "devDependencies": {
        "pnpm": "=6.12.1"
      }
    }
  2. Run npm i
  3. pnpm@6.12.1 is now installed locally.
    $ npm x  -q --yes -- pnpm --version
    6.12.1
  4. Run pnpm 6.13.0 now: npm x won't honor the version
    $ npm x -q --yes --package="pnpm@6.13.0" -- pnpm --version
    6.12.1

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
@jcayzac jcayzac added Bug thing that needs fixing Needs Triage needs review for next steps Release 7.x work is associated with a specific npm 7 release labels Aug 20, 2021
@janpio
Copy link

janpio commented Apr 6, 2022

I think this issue is a duplicate of #3210 (also read comments).

@nlf
Copy link
Contributor

nlf commented Apr 27, 2022

closing as duplicate of #3210

@nlf nlf closed this as not planned Won't fix, can't repro, duplicate, stale Apr 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug thing that needs fixing Needs Triage needs review for next steps Release 7.x work is associated with a specific npm 7 release
Projects
None yet
Development

No branches or pull requests

3 participants