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

Wrong version of jest-cli is executed when jest is installed next to an existing install of jest-cli #7867

Closed
ronaldborman opened this issue Feb 11, 2019 · 2 comments
Labels

Comments

@ronaldborman
Copy link

🐛 Bug Report

When I install a (later) version of the jest package in a project where only (an older version of) the jest-cli package is installed in the root node_modules folder, Node still forwards to that version of the jest-cli package (although jest has the correct version of jest-cli in its own nested node_modules folder).

To Reproduce

  1. md jest-issue
  2. cd jest-issue
  3. npm install -D [email protected]
  4. npm install -D jest
  5. node_modules\.bin\jest --version (which returns v20.0.4 and not v24.1.0)

I'm using Node 8.9.4 and npm 5.10.0.

Expected behavior

Node forwards to the nested version of jest-cli.

I've checked and the right (newer) version of jest is started, but execution is then forwarded to the older jest-cli package.

The base install (only jest-cli in the root node_modules folder) actually happens on a SharePoint SPFx project, which is generated with a Yeoman generator. The jest-cli package is a dependency of a SPFx package. I installed the newer version of Jest manually after the initial generation.

When I investigated this issue, I came across issue #5294, which describes a similar situation but with a different package hierarchy and initial starting point.

@thymikee
Copy link
Collaborator

This depends on package manager you use. If you install jest-cli along jest anywhere, you need to make sure they point to the same version.

@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 12, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants