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

[Bug]: (Windows 10) Running fabric --gui results in an error #369

Closed
1 task done
Gerkinfeltser opened this issue Apr 27, 2024 · 5 comments
Closed
1 task done

[Bug]: (Windows 10) Running fabric --gui results in an error #369

Gerkinfeltser opened this issue Apr 27, 2024 · 5 comments
Labels
bug Something isn't working

Comments

@Gerkinfeltser
Copy link

What happened?

Thanks again so much for the interesting project!
I'm getting a FileNotFoundError when I attempt to run fabric --gui

PS C:\Users\xxx\> fabric --gui
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "C:\Users\xxx\.local\bin\fabric.exe\__main__.py", line 7, in <module>
  File "C:\Users\xxx\AppData\Local\pipx\pipx\venvs\fabric\Lib\site-packages\installer\client\cli\fabric.py", line 100, in main
    run_electron_app()
  File "C:\Users\xxx\AppData\Local\pipx\pipx\venvs\fabric\Lib\site-packages\installer\client\cli\utils.py", line 774, in run_electron_app
    subprocess.run(['npm', '--version'], check=True,
  File "C:\ProgramData\anaconda3\Lib\subprocess.py", line 548, in run
    with Popen(*popenargs, **kwargs) as process:
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\ProgramData\anaconda3\Lib\subprocess.py", line 1026, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "C:\ProgramData\anaconda3\Lib\subprocess.py", line 1538, in _execute_child
    hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [WinError 2] The system cannot find the file specified

Furthermore,

  • both Node & npm are installed (as well as electron) & the commands are in my user's path.
  • Running the fabric --gui command gives me the same error when in the fabric venv or not.
  • I'm running fabric on Windows 10.

Thanks again!

Version check

  • Yes I was.

Relevant log output

No response

Relevant screenshots (optional)

No response

@Gerkinfeltser Gerkinfeltser added the bug Something isn't working label Apr 27, 2024
@danielmiessler
Copy link
Owner

Try again I think we fixed some WSL stuff recently.

@Gerkinfeltser
Copy link
Author

Hmmm, still no luck. Just updated but the error persists.

@Gerkinfeltser
Copy link
Author

Hello again, I was able to get the --gui working after some trial and error. My solution isn’t the best as it requires adding a hard coded path to npm but for my current purposes this is an acceptable trade off. Both node & npm were installed prior & npm's location added to my system path but fabric still seemed to be having issues finding them. Not exactly sure of the reason for my troubles but I assume it’s connected to multiple venvs, conda, etc. but I haven’t looked too deeply into it. I'm just relieved its working.

Anyway, here’s what got the gui running for me on windows 10:

  1. In the C:\Users\XXX\AppData\Local\pipx\pipx\venvs\fabric\Lib\site-packages\installer\client\cli\utils.py file’s run_electron_app method (last one in the file) I added npm_path = r'C:/Program Files/nodejs/npm.cmd' (replace the path with the correct one for your setup of course).
    Example:
...
def run_electron_app():
    
    npm_path = r'C:/Program Files/nodejs/npm.cmd'
...
  1. In the same method, replace instances of ’npm’ (with quotes) with the newly added npm_path variable (without quotes). In the current version, there were 3 instances that needed to be changed.

Hopefully no one else runs into this issue but for the benefit of those who do (& to a future me that needs to remember how I get this working) I’ll leave this here!

Thanks again for the project!

@freshlesh3
Copy link

Hi. I'm not nearly as versed as everyone here in the CLI. Could we walk through how to install NPM, Node and Electron in WSL in the CLI. I would love to use the GUI and start using this project. Looks really interesting.

@nour-s
Copy link

nour-s commented Jun 19, 2024

I have the same issue, and I just installed the latest fabric version.
I'm using nvm though and I'm running fabric on powershell which works fine if I don't use the --gui

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants