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.

Jest can't find node on /usr/bin/env

See original GitHub issue

Environment

  1. node -v: 9.5.0

  2. npm -v: 5.6.0

  3. Operating system: Elementary OS 0.4.1 (based on Ubuntu 16.04.03 lts)

Steps to Reproduce

I tried to use https://github.com/Microsoft/TypeScript-Node-Starter . followed the steps. and npm install.

Launch vscode

got this message on output section of vscode

/usr/bin/env: ‘node’: No such file or directory

Closed Jest
Starting watch mode
Closed Jest
/usr/bin/env: ‘node’: No such file or directory

Closed Jest
Jest exited unexpectedly, restarting watch mode
Closed Jest
/usr/bin/env: ‘node’: No such file or directory

Closed Jest
Jest exited unexpectedly, restarting watch mode
Closed Jest
/usr/bin/env: ‘node’: No such file or directory

Closed Jest
Jest exited unexpectedly, restarting watch mode
Closed Jest
/usr/bin/env: ‘node’: No such file or directory

Closed Jest
Closed Jest

Installed node with with https://github.com/tj/n . /usr/bin/env node works perfectly for me.

Expected Behavior

vscode jest should run properly

Actual Behavior

vscode shows jest-stopped(too many restarts)


Note we are looking for someone to take responsibility around keeping create-react-app up to date and working, could this be you?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6

github_iconTop GitHub Comments

2reactions
Emobecommented, Nov 20, 2019

@muhajirdev that doesn’t mean it’s working, that is just a workaround. The main problem is if you install node with NVM, code struggles at locating node

2reactions
muhajirdevcommented, Apr 5, 2018

I was using elementaryOS, I tried to open vscode with code command from terminal.

cd to the directory and code .

Read more comments on GitHub >

github_iconTop Results From Across the Web

Jest cannot find module with relative path on docker
The problem: When running the jest tests written in TS on docker as part of a Jenkins pipeline, I got: Cannot find module...
Read more >
Can't run Jest TypeScript tests when using remote interpreter
Create template @vue/cli project with TypeScript and Jest. Run Jest tests via interpreter from Docker. Get: Error: An error occurred while adding the...
Read more >
yargs - npm
Yargs helps you build interactive command line tools, by parsing arguments and generating an elegant user interface. It gives you: commands and ...
Read more >
Testing constructs - AWS Cloud Development Kit (AWS CDK) v2
The standard approach to testing AWS CDK apps uses the AWS CDK's assertions module and popular test frameworks like Jest for TypeScript and...
Read more >
Husky - Git hooks
Yarn 2+ doesn't support prepare lifecycle script, so husky needs to be installed ... if you see the help message when running npx...
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