Flow-for-vscode: Cannot find node in path

Created on 13 Jul 2018  路  5Comments  路  Source: flowtype/flow-for-vscode

OS: Ubuntu 16.04
flow-bin: 0.65.0

Whenever I open up a file i get the error message 'Cannot find node in PATH. The simplest way to resolve it is install node globally'. I assume this has something to do with using nvm? What can I do to remedy this?

When I type which node i get:
/domtwlee/.nvm/versions/node/v10.4.0/bin/node

So it is installed, perhaps the extension can't detect it's path?

Most helpful comment

I have the same issue. It seems to be tied to some issue with VSCode and nvm-based node installs as a whole.

You can fix it by running nvm use before starting VSCode via command line.
Make sure you have a default node set.
list node version installed: $ nvm ls
set default: $ nvm alias default <your version number here>
use it: $ nvm use default
run code: $ code

or if you have everything set up already use a one liner: $ nvm use default; code

All 5 comments

I have the same issue. It seems to be tied to some issue with VSCode and nvm-based node installs as a whole.

You can fix it by running nvm use before starting VSCode via command line.
Make sure you have a default node set.
list node version installed: $ nvm ls
set default: $ nvm alias default <your version number here>
use it: $ nvm use default
run code: $ code

or if you have everything set up already use a one liner: $ nvm use default; code

I made a Unity launcher .desktop file for VSCode to set the node version before launching VSCode.
You can find the gist here

Let me know if that works for you :)

@Pitt-Pauly Thanks! Seems to have fixed the issue.

I did the following to resolve this issue:

  • put alias code=nvm use default; code in _.zshrc_ file (should work with _.bashrc_, too)
  • reinstalled vscode

Now when I start code, it picks up the default nvm version before launching code.

I find that opening a file/folder/workspace via the code CLI command solves this issue as well, without the need to add nvm use default

Was this page helpful?
0 / 5 - 0 ratings

Related issues

yurtaev picture yurtaev  路  3Comments

jpokrzyk picture jpokrzyk  路  6Comments

sgronblo picture sgronblo  路  6Comments

micmro picture micmro  路  4Comments

vojtatranta picture vojtatranta  路  4Comments