Skip to content
This repository has been archived by the owner on Aug 7, 2023. It is now read-only.

Should support use project local flow bin #166

Open
kerryChen95 opened this issue Jun 5, 2017 · 10 comments
Open

Should support use project local flow bin #166

kerryChen95 opened this issue Jun 5, 2017 · 10 comments

Comments

@kerryChen95
Copy link

I use linter-flow without npm i -g flow-bin, and get error:

~/.atom/packages/linter/lib/linter-registry.js:159 [Linter] Error running Flow Error: Failed to spawn command flow. Make sure flow is installed and on your PATH

I think linter-flow should support use project local flow bin as optional, for example use <project root>/node_modules/.bin/flow if it exists, so we can use the same version of flow bin for both Atom's linter-flow and command npm run flow.

@nwshane
Copy link

nwshane commented Jul 18, 2017

Any updates on this?

@stackptr
Copy link

This is also reflected in the Flow install docs as a best practice: https://flow.org/en/docs/install/

Flow works best when installed per-project with explicit versioning rather than globally.

@nwshane
Copy link

nwshane commented Jul 19, 2017

I thought using local flow didn't work when I was looking into this yesterday, but it turns out that I had my linter package disabled. I'm using linter-flow 5.6.0, I set ./node_modules/.bin/flow as my flow executable in linter-flow's settings, and it's working as expected.

Hope that's useful to someone.

@stackptr
Copy link

It makes sense that that setting would work, but I don't feel it's very intuitive + the default assumption is a global install when that seems like it should be the special case (with the default to using node_modules)

I was looking at how AtomLinter/linter-eslint accomplishes using local vs global versions of the linting tool (though it seems I might be unaware of certain requirements specifically relating to flow running as a server) and it seems like some of that logic can be ported pretty readily. I would be a fan of a simpler solution to default to ./node_modules/.bin/flow unless a global instance is indicated, but I think this falls short when working directories are set inside/outside that root directory where node_modules lives.

Hoping to submit a PR for this issue soon!

@alexbainter
Copy link

alexbainter commented Aug 1, 2017

For anyone else on Windows, you'll need to use backslashes instead of forward slashes (.\node_modules\.bin\flow)

@far-blue
Copy link

I can't get the ./node_modules/.bin/flow trick to work and would really prefer either than flow was bundled in the plugin or that the plugin was able to find and use a local flow binary rather than installing one globally.

@mifrej
Copy link

mifrej commented Aug 28, 2017

+1 for project specific "local". This is how linter-eslint works and so that should this very one also followed same pattern

@stackptr
Copy link

stackptr commented Sep 6, 2017

This is a rough first pass: #180

@mileung
Copy link

mileung commented Jun 15, 2018

I think I'm getting the same issue, but I have the linter package enabled.

[Linter] Error running Flow Error: Failed to spawn command flow. Make sure flow is installed and on your PATH

Or is this a different issue?

screen shot 2018-06-15 at 3 01 33 pm

@el1f
Copy link

el1f commented Mar 3, 2019

This in particular makes it even less obvious
image

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

No branches or pull requests

8 participants