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.

Feature - Run jest with specified node version from .nvmrc file

See original GitHub issue

Since the plugins starts without allowing the user to specify what version of node should be used, and use the default selected version in its own process, it is not yet possible to select what version of node should be used.

In my case, my default nvm node version is 4.x. But my project has a .nvmrc with 6.9.1 in it. But Jest uses the default one. (which makes the whole extension unusable since it crashed instantly)

Would it be possible to either specify what path of node we want Jest to use, or, more simply, run a nvm use before the plugin starts if there is a .nvmrc file in the root folder?

Issue Analytics

  • State:open
  • Created 7 years ago
  • Reactions:21
  • Comments:10 (2 by maintainers)

github_iconTop GitHub Comments

7reactions
mjpieterscommented, Jan 30, 2021

During debugging, this extension uses vscode’s debug infrastructure that used launch.json; during the regular test run/watch it spawns a node process instead. It would default to the node version from your default shell… I use nvm and it works fine. Do you guys actually want to use a different node version than your default nvm?

Yes, I’d want to use the version specified in the .nvmrc file, not the shell default.

3reactions
roni-frantchicommented, Jul 19, 2019

I know this issue is pretty old, is there a proposed solution or suggested workaround on how to get the watch test use the right node version using nvm?

For what it’s worth, when using the debug launch lens, it uses the node version specified in in launch.json, so that works. But the watched test seems to not be using launch…?

Read more comments on GitHub >

github_iconTop Results From Across the Web

VSCode Jest extension using the wrong version of Node
This issue is tracked within the jest-community/vscode-jest#72 . ... system to use the Node version specified within your .nvmrc by default:
Read more >
Specify Node Versions with .nvmrc - David Walsh Blog
A project with this .nvmrc is specifying that Node.js v16 should be used. Any developer could then run nvm use to download, install, ......
Read more >
Visual Studio Code to use node version specified by NVM
In VS Code: go to your launch.json file; add the runtimeVersion attribute inside configurations as shown below.
Read more >
Using .nvmrc to Specify Node Version - TecAdmin
After that you can simply run commands like nvm use, nvm install and nvm run etc. This will the default node.js version defined...
Read more >
Why and how to use stable node and npm versions across ...
In the package.json file, we can specify the versions that should be used for ... .env file, I read my .npm-version and .nvmrc...
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