atom-ide-flow
atom-ide-flow copied to clipboard
Does not seems to work with flow version 0.17.0
running type check produces following error in the web-inspector console:
env: node: No such file or directory util-flow-command.coffee:30
I've briefly looked into and it seems like error is coming from flow itself, more specifically here is some of my observations:
I set a breakpoint on the above mentioned line to try to figure what is going on and found out following:

So I tried running same from the terminal:
/usr/local/bin/flow type-at-pos 22 48 --json --path /Users/gozala/Projects/reflex-virtual-dom-renderer/src/node.js
That keeps hanging while this produces similar error as I see in terminal:
/usr/local/bin/flow type-at-pos 22 48 /Users/gozala/Projects/reflex-virtual-dom-renderer/src/node.js --json
File not found
While following seems to work fine:
/usr/local/bin/flow type-at-pos /Users/gozala/Projects/reflex-virtual-dom-renderer/src/node.js 22 48 --json
{"type":"(unknown)","reasons":[],"path":"","line":0,"endline":0,"start":1,"end":0}
My guess is something else deals with --path
and it also is passed after line & colon which makes my guess is no longer supported by [email protected]
Ok so I have tried changing following line https://github.com/lukehoban/atom-ide-flow/blob/master/lib/util-flow-command.coffee#L79 to:
args: ['type-at-pos', fileName, bufferPt.row + 1, bufferPt.column + 1, '--json']
Which does not seem to resolve it. From web inspector I can now get a command to run in my terminal:
getFlowCommand() + ' ' + args.join(' ') // => /usr/local/bin/flow type-at-pos /Users/gozala/Projects/reflex-virtual-dom-renderer/src/node.js 14 36 --json
and running it in terminal produces following:
/usr/local/bin/flow type-at-pos /Users/gozala/Projects/reflex-virtual-dom-renderer/src/node.js 14 36 --json
{"type":"(unknown)","reasons":[],"path":"","line":0,"endline":0,"start":1,"end":0}
So I'm clueless to what is going on, only other thing worth noting is that I have flow installed through flow-bin
package which creates /usr/local/bin/flow
symlink:
readlink /usr/local/bin/flow
../lib/node_modules/flow-bin/cli.js
But updating flow path to an actual file still does not seem to work so I'm giving up.
After digging further into it I realized that flow-bin is node-wrapper that uses actual flow
binary bundled with it under vendor/flow
. I have updated my flow path to /usr/local/lib/node_modules/flow-bin/vendor/flow
which resolved the issue.
Give that flow-bin
is one of the recommended install paths on the flow readme I suggest to either handle such installation or at least add section into readme to document this as a pitfall.
BTW changes I made originally did not turn out to be necessary after fixing the path.
For people who stumble across this issue I had a similar initial error env: node: No such file or directory util-flow-command.coffee:41
This turned out to be because my path (in atoms debugger, using process.env.PATH
) did not include /usr/local/bin
which is where npm installed flow-bin. I was able to use flow in my terminal because the correct PATH is set in my .zshrc. It turned out that this issue would only occur when I opened atom from the dock, and not when I opened it from the command line. There is a solution to that specific issue here.
Running this command worked for me $ npm install --global flow-bin
.