danielmiessler / fabric

fabric is an open-source framework for augmenting humans using AI. It provides a modular framework for solving specific problems using a crowdsourced set of AI prompts that can be used anywhere.
https://danielmiessler.com/p/fabric-origin-story
MIT License
18.64k stars 1.91k forks source link

[Bug]: WSL UNC paths are not supported in fabric --gui #575

Open EMREOYUN opened 4 weeks ago

EMREOYUN commented 4 weeks ago

What happened?

Install fabric as usual in WSL and try running fabric --gui

Version check

Relevant log output

username@machinename:~$ fabric --gui
Running 'npm install'... This might take a few minutes.

up to date, audited 161 packages in 1s

26 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities
'npm install' completed successfully. Starting the Electron app with 'npm start'...

> fabric_electron@1.0.0 start
> electron .

'\\wsl.localhost\Debian\home\username\.local\pipx\venvs\fabric\lib\python3.11\site-packages\installer\client\gui'
CMD.EXE was started with the above path as the current directory.
UNC paths are not supported.  Defaulting to Windows directory.
'electron' is not recognized as an internal or external command,
operable program or batch file.
An error occurred while executing NPM commands: Command '['npm', 'start']' returned non-zero exit status 1.

Relevant screenshots (optional)

No response

AlainPaumen commented 3 weeks ago

This is probably because you are running npm from windows and not within WSL. If you type 'which npm' in the cli, it should return a linux directory in the format '/home/[username]/...' and not a windows directory. Install node via nvm in WSL and your electron app will run. Drag&Drop doesn't work though :-(

EMREOYUN commented 3 weeks ago

/pipx/venvs/fabric/lib/python3.11/site-packages/installer/client/gui/node_modules/electron/dist/electron: error while loading shared libraries: libnss3.so: cannot open shared object file: No such file or directory An error occurred while executing NPM commands: Command '['npm', 'start']' returned non-zero exit status 127.

It still does not work. However, UNC path problem is gone.

AO12612 commented 1 week ago

it's not WSL related. I'm on linux, in a kali distrobox container and I got:

deck@fabric:/home/deck/Fabric$ fabric --gui Running 'npm install'... This might take a few minutes.

up to date, audited 161 packages in 715ms

26 packages are looking for funding run npm fund for details

found 0 vulnerabilities 'npm install' completed successfully. Starting the Electron app with 'npm start'...

fabric_electron@1.0.0 start electron .

/home/deck/.dbx/fabric/.local/share/pipx/venvs/fabric/lib/python3.11/site-packages/installer/client/gui/node_modules/electron/dist/electron: error while loading shared libraries: libnss3.so: cannot open shared object file: No such file or directory An error occurred while executing NPM commands: Command '['npm', 'start']' returned non-zero exit status 127.

libnss3 had not been caught by any dependency and needed to be installed manually.

sudo apt install libnss3 on my debian derived distro. ymmv