Vscode-jest: Jest can't find node on /usr/bin/env

Created on 18 Feb 2018  Â·  6Comments  Â·  Source: jest-community/vscode-jest

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?

Most helpful comment

@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

All 6 comments

Nevermind, it works now

@muhajirframe, what did you do to get it working?

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

cd to the directory and code .

@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

@Emobe What is the solution though? I am able to run node from bash inside VSC, but on vscode-jest it fails.

@kevinfarrugia try this
https://github.com/jest-community/vscode-jest/issues/105#issuecomment-642732699

This solved my issue.

Was this page helpful?
0 / 5 - 0 ratings