vscode-flow-ide
vscode-flow-ide copied to clipboard
"Cannot find flow in path" despite being in path
I have the flow exe installed at "C:\Program Files\nodejs\node_modules\flow-bin\flow-win64-v0.37.3\flow.exe", and the folder "C:\Program Files\nodejs\node_modules\flow-bin\flow-win64-v0.37.3" is added to the system PATH environment variable, and yet I still get the error above.
It seems to be spawning flow exe's when vs-code launches (and it has the same cpu-usage patterns as the main facebook flow extension), and yet it doesn't actually result in any syntax highlighting or the like.
You need to set "flowide.pathToFlow"
to "flow". It's weird, but works.
Additionally, this plugin spawns mutiple flow processes, and some of them end up eating a lot of cpu resources, but don't actually seem to do anything. Probably they are stuck parsing the code over and over again, or lost among node_modules... I don't know, but it doesn't seem like the plugin works very well, or it gives linting errors after about 5-30 seconds after typing. or all of this might be flow's problem on Windows.
I have the same problem
- I've installed flow locally using npm
- i set the flowide.pathToFlow to the flow exe in "c:/...node_modules/flow-bin/flow-win64-v0.37.3/flow.exe"
- but it still shows this error message
@slender- set it to 'flow' not '...../flow.exe'.
Is this still an issue? Just a note, the flow processes reported are started by Flow itself.
Setting it to flow
didn't work for me, instead, I have set the flow.useNPMPackagedFlow": true
setting so I can use different versions of flow depending on the project, although I don't know if it's the correct way of doing it
I have a mac and I have this issue too... And "flow.enabled": true,
already 😞
If I start vscode trough command line it finds global flow, but if I try to open it via GUI it does not.
Still doesn't work on Windows. It's available on PATH (from every other application I can run flow.exe
from it's environment). I've also tried setting the flowide.pathToFlow
to both absolute path to exe, and absolute path to directory. Reloaded window, reinstalled the application. Nothing worked, always shows message [Flow] Cannot find flow in PATH...
.
@martincohen : Please upgrade to latest version (1.2.0) , I've made a bunch of fixes regarding on how the paths are picked up. If it still doesn't work please run '"Flow-IDE: Show path to Flow' command ( Open command pallete and type the command) to see what's the path to Flow that vscode-flow-ide picks up and ensure that is correct.
Anyone still having Windows issues on latest ? If not I'll close it.
Got recent version (just a few seconds ago). It seems to work correctly on my Mac, but on Windows I get this when I try "Show path fo Flow" (it "worked" before I restarted vscode):
When it "worked" it has shown something in the lines of path:flow
and not the path I've set in the settings. Also on Windows it stopped showing "Cannot find flow in path" error.
What I've tried is also setting the path to "flowide.pathToFlow": "${workspaceRoot}\\node-modules\\flow-bin"
on Windows in Workspace settings. It started to work. But I don't really know what path it is using really, it might be it just works thanks to globally installed flow-bin
. Please ping me if you manage to fix the "Show path to Flow", or if I did something wrong (is setting to Workspace settings even having an effect?).
Regarding the error 'command flow.path not found' I believe it's something VSCode related. Let me know what VSCode version and Win version you are using ( I just cannot imagine why it wouldn't work after restart on Win). I'll try to reproduce also on a Win Machine afterwards.
Regarding the setup you need to make sure there are 2 things set(and restart the IDE any time you modify them):
- "flowide.enabled" : true
- Leave "flowide.pathToFlow" empty
The extensions looks for Flow in the following locations and in this order :
- In the path specified by "flowide.pathToFlow". If empty, then check step 2)
- In node_modules in current workspace root. On Win the path checked is '{workspaceRoot}\node_modules\.bin\flow.cmd' . Make sure that this path exists and that
flow.cmd
is in there. If not, it checks step 3 - Tries to use
flow
that is installed globally
For reference, I've pasted below the code snippets that do these checks, as localized in src/utils.ts
.
export function nodeModuleFlowLocation(rootPath: string): string {
if (process.platform === 'win32') {
return `${rootPath}\\node_modules\\.bin\\flow.cmd`
} else {
return `${rootPath}/node_modules/.bin/flow`
}
}
export function getPathToFlowFromConfig(): string {
const config = workspace.getConfiguration('flowide');
if (config) {
return config.get('pathToFlow').toString();
}
return '';
}
export function determineFlowPath() {
let pathToFlow = '';
const localInstall = getPathToFlowFromConfig() || nodeModuleFlowLocation(workspace.rootPath);
if( fs.existsSync(localInstall) ) {
pathToFlow = localInstall;
} else {
pathToFlow = 'flow';
}
return pathToFlow;
}
I've encountered this issue too, what I did is install flow-bin globally but do not install it via yarn, it will still not work install it globally via npm restart vscode and for me it seemed to work now so far
For me this seems to be broken. Running windows 10. If I do set pathToFlow it says that flow is not in path (even though it is). When I leave it out I see that flow processes get started but I do not get any error highlighting in my editor.
This was all working perfectly fine for me yesterday btw. It literally broke overnight without updating anything
I had the same issue when I had installed flow with yarn.
I followed the recommendation from @Jplus2, installed flow-bin globally with npm like this
npm i -g flow-bin
and restarted vscode. Now it works.
I resolved this issue by adding an absolute path in workspace settings for "flowide.pathToFlow"
.
Same solution as @Jplu2. This really needs to be fixed; for now, fortunately, this is the only project I'm using Yarn for, otherwise, I would need to drop the global install for project-specific installations of flow (that actually work).
Otherwise, good VS Code extension compared to the very broken alternative, "Flow Language Support".