-
Notifications
You must be signed in to change notification settings - Fork 293
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
command not found: jest
#899
Comments
Installing |
This sounds like a monorepo project set-up issue. Please take a look at the troubleshooting/jest-failed-to-run, particularly the monorepo projects section. Let me know if it helps. |
This also happen to me after updated my VSCode to the newest (Version: 1.71.1 (Universal)), my Test Editor also does not work anymore. *I am using multi-root workspace. Before updating my VSCode, all works fine, even the Test Editor shows correctly. |
The setup is correct. |
@taschetto, I can take a deeper look if you can put together a sample repo. @gedclack, does it return to normal if you restart |
@connectdotz Yes! I am on MacOS, I need to quit VSCode and open it again. It does not work if I only Close the editor window. |
Same here, but extension is not working, although I quit VS Code. I have a monorepo, everything was working fine (I configured some months ago). I started getting this message around the end of August. Not only that, but I guess something has changed in VS Code, when I shut down my macOS (keeping my applications open for the next session), I get a warning message about some environment variable could not be initialized. The problem is related to NVM (which I use), but if I restart VS Code that warning disappears and shell environment are loaded successfully. But this is still there: Just in case it can be related in any way. Maybe this information can help you, maybe not. |
@javifm86 are you able to examine the process env of the spawned process? exit code 127 means "command not found", which usually indicates process.env is not fully set up as expected. See self-diagnosis for how to check process.env. It is interesting that it was working fine until Aug...🧐 |
Sure. Today the frontend part is working fine (I would swear I checked it on Fridays, and it was not working), but the backend part is not working. Here you have the relevant information from DevTools for backend:
|
It seems vscode didn't initialize the process env completely. For people who frequently bumped into this issue, you can try switching to login shell added in v5 (still pre-release), and let us know if it resolved your issue. if this works out well, we could even consider making the login shell the default. Then we don't need to rely on vscode's start-up initialization, which looked quite unstable... This is a frequent complaint. We should either address the root cause or otherwise provide a self-help tool to diagnose and suggest possible solutions accordingly. Asking people to read documents just didn't seem very efficient. 🤔 |
@taschetto I looked at your original issue content more closely today, and noticed your comment:
Not sure if it is a typo or a real problem, but you should set Anyway, let us know if that resolves your issue. |
Last Fridays it worked again, but today it is not working, therefore the initialization for VSCode is causing the problem. I will try the login shell. Thank you for your time. |
for people who landed here, we believe most of the issues have been addressed in v5 pre-release, please feel free to give it a spin and let us know otherwise. |
Using the pre-release version v5.2 but still same problem. Sometimes it works other times it doesn't. |
@asifrahmanvm, what is the error message when it fails? |
I was encountering this error when trying to follow someone else's code, this is the example repo Every time I ran By doing In short, I had to make sure the package was properly installed. |
Environment
vscode-jest version
: 4.6.0node -v
: 14.20npm -v
oryarn --version
: 8.18.0npm ls jest
ornpm ls react-scripts
(if you haven’t ejected):Prerequisite
npm run test
ornode_modules/.bin/jest
)npm run test
Steps to Reproduce
We have a monorepo with the following structure:
The extension works fine for projects inside
packages/
. But we also have a project at the root level.
(CDK project, tests inside./tests
, can run tests in the terminal withnpm run tests
)Whenever I try to run tests via the Text Explorer for that particular project, I get:
Expected Behavior
It should run the tests.
Actual Behavior
The text was updated successfully, but these errors were encountered: