Skip to content
This repository has been archived by the owner on Dec 19, 2024. It is now read-only.

Use local flow-bin package #69

Closed
lednhatkhanh opened this issue Jan 13, 2017 · 8 comments
Closed

Use local flow-bin package #69

lednhatkhanh opened this issue Jan 13, 2017 · 8 comments

Comments

@lednhatkhanh
Copy link

Hello, I'm trying to install flow locally inside my project and I also have enable the flow.useNPMPackagedFlow but vscode keeps saying that I still need to install flow-bin globally. I'm I doing something wrong? Thank you.

@orta
Copy link
Contributor

orta commented Jan 13, 2017

I'd recommend downloading and running the extension locally with the debugger attatched to determine why it is not finding the flow binary, this is working for me and everyone on my team.

@JPanneel
Copy link
Contributor

Hello, I am seeing the same behaviour as @lednhatkhanh. I ran the extension locally, attached the debugger to find out what was going on.

My configuration:

  • Windows
  • flow.useNPMPackagedFlow = true
  • node_modules\.bin\ is not in the Path environment variable
  • in cmd where where returns C:\Windows\System32\where.exe

When flow.useNPMPackagedFlow === true this extension spawns where <possible_flow_path> to determine whether or not flow is installed at that location. However, the possible_flow_path is an absolute path, including drive letter. where returns an error if I try this:

C:\Users\jensp>where C:\Users\jensp\development\Project\node_module\.bin\flow.cmd 
ERROR: Invalid pattern is specified in "path:pattern".

I see two reasons why there are Windows users for whom flow.useNPMPackagedFlow = true works:

  • Either the local node_modules\.bin folder is in the Path environment variable. ( This works because the extention defaults to 'flow' as the possible_flow_path if everything else fails and where flow is a valid command.)
  • Or the first where command on there Path is not C:\Windows\System32\where.exe but rather an executable that has the same behaviour as the unix which command. ( Possibly by including the bin folder bundled with git for windows ? )

I think we should not have to have the local node_modules\.bin folder on the path, nor should we depend on the presence of a non standard executable. Rather the extension should always use the where command included by Windows and use the format for that tool. For example this works:

C:\Users\jensp>where /r C:\Users\jensp\development\Project\node_modules\.bin flow.cmd
C:\Users\jensp\development\Project\node_modules\.bin\flow.cmd

I will give it a shot: Pull Request incoming...

@MoOx
Copy link

MoOx commented Jan 27, 2017

With some colleagues we are having the same issue on Windows. Impossible to have this package to actually work.
#70 seems to be the way to go.

@orta
Copy link
Contributor

orta commented Jan 27, 2017

@MoOx can you confirm the PR works? We don't have any windows machines to test on, and it's only the author's "works on my machine" right now

@MoOx
Copy link

MoOx commented Feb 1, 2017

Sorry I don't have a windows machine around (and I am too lazy to try this PR in a VM as I don't have one yet) and my colleagues on Windows are even more lazy... :)

@gabelevi
Copy link
Contributor

Just tested #70 on Windows and it worked for me! Merged it and will publish shortly. Closing this issue out for now. Thanks @JPanneel for the fix and sorry for the delay in merging!

@bchenSyd
Copy link

bchenSyd commented Jun 4, 2018

I'd recommend downloading and running the extension locally with the debugger attatched

Can you please elaborate on this? Just did a googling around and the instruction is not clear. Thanks!
@orta @JPanneel

@orta
Copy link
Contributor

orta commented Jun 4, 2018

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

6 participants