question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

No way to use jest installed within Windows Subsystem for Linux

See original GitHub issue

Environment

  1. node -v: no version installed

  2. npm -v: no version installed

  3. npm ls react-scripts (if you haven’t ejected): N/A

  4. Operating system: Windows 10 + WSL

Steps to Reproduce

Use Windows 10 + Windows subsystem for linux. Install node/npm/jest within the subsystem only, not in windows.

Expected Behavior

There should be a way to use the version of jest installed within WSL rather than duplicating the installation of all the tools required, once within linux and once in windows

Actual Behavior

'jest' is not recognized as an internal or external command, operable program or batch file.

(Quite rightly, as there’s absolutely no node/jest/npm installed outside WSL)


I’ve tried to look through docs and other open bugs but cannot find anything similar, apologies if I’ve missed it! Note that I’m not sure if there are any guidelines for extension authors around using WSL, but it’s e.g. possible to debug files using node installed within WSL, so assuming it’s doable for extensions as well.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:11
  • Comments:36 (10 by maintainers)

github_iconTop GitHub Comments

9reactions
stephtrcommented, May 22, 2018

That answers my question. You could set "jest.pathToJest": "node node_modules/jest/bin/jest.js" in VS Code’s settings, which should work with your setup (since jest.cmd basically just runs that command).

Read more comments on GitHub >

github_iconTop Results From Across the Web

Debugging Jest Tests in Visual Studio Code When Using WSL
In this blog post, I'll show how to configure Visual Studio Code as a debugging environment for Jest tests. As an extra, the...
Read more >
Install Linux on Windows with WSL - Microsoft Learn
Install Windows Subsystem for Linux with the command, wsl --install. Use a Bash terminal on your Windows machine run by your preferred Linux ......
Read more >
Nodejs and npm setup on WSL - Evan Calzolaio - Medium
Install Node via a Windows installer (if you plan on using it with WSL); Don't even apt-get install nodejs. Do: Install nvm. Why?...
Read more >
After installing npm on WSL Ubuntu 20.04 I get the message ...
Then restart WSL2 with command wsl --shutdown in Windows. ... subsystem for Linux is to perform the initial Nodejs install not using the ......
Read more >
Jest | WebStorm Documentation - JetBrains
You can run and debug tests with Jest right in WebStorm. ... and Using Node.js on Windows Subsystem for Linux for details.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found