Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does not seems to work with flow version 0.17.0 #41

Open
Gozala opened this issue Oct 12, 2015 · 7 comments
Open

Does not seems to work with flow version 0.17.0 #41

Gozala opened this issue Oct 12, 2015 · 7 comments

Comments

@Gozala
Copy link

Gozala commented Oct 12, 2015

running type check produces following error in the web-inspector console:

env: node: No such file or directory util-flow-command.coffee:30
@Gozala
Copy link
Author

Gozala commented Oct 12, 2015

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:

screen shot 2015-10-12 at 11 10 22 am

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]

@Gozala
Copy link
Author

Gozala commented Oct 12, 2015

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}

@Gozala
Copy link
Author

Gozala commented Oct 12, 2015

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.

@Gozala
Copy link
Author

Gozala commented Oct 12, 2015

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.

@Gozala
Copy link
Author

Gozala commented Oct 12, 2015

BTW changes I made originally did not turn out to be necessary after fixing the path.

@anthillape
Copy link

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.

@madson
Copy link

madson commented Jan 30, 2017

Running this command worked for me $ npm install --global flow-bin.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants