fnm icon indicating copy to clipboard operation
fnm copied to clipboard

fish: Unknown command: fnm

Open dcorb opened this issue 2 years ago • 6 comments

After installing fnm in fish, following the steps, and starting a new fish terminal :

fish: Unknown command: fnm
~/.config/fish/conf.d/fnm.fish (line 4):
  fnm env | source

It seems fnm command is not visible to fish yet? But running "fnm" in fish shell is recognized.

I fixed it by adding the full path: (~/.config/fish/conf.d/fnm.fish)

# fnm
set PATH /Users/david/.fnm $PATH
/opt/homebrew/bin/fnm env | source

dcorb avatar Mar 06 '22 22:03 dcorb

How did you install fnm? Through the installation script?

Schniz avatar Mar 07 '22 08:03 Schniz

Yes, I used the installation script Got a new M1 laptop, installing everything from scratch (latest versions), iterm2, homebrew, fish, fnm. I restarted, to see if helps, it didn't.

dcorb avatar Mar 07 '22 11:03 dcorb

I've the same problem with M1 chip and fish shell image

buraksirma avatar Mar 14 '22 07:03 buraksirma

Oh no. Looks like the fnm script got loaded before Homebrew added it to the $PATH. Can you try append the contents from ~/.config/fish/conf.d/fnm.fish into your fish config? (and comment out the lines in the original file)

Schniz avatar Mar 14 '22 09:03 Schniz

@Schniz It looks like you are right. https://github.com/fish-shell/fish-shell/issues/3099

Files in the conf.d folder are getting executed before config.fish and I'm supplying homebrew's path in config.fish. As a workaround I gave the full path of fnm executable in conf.d/fnm.fish like @dcorb mentioned.

buraksirma avatar Mar 15 '22 12:03 buraksirma

aah, this makes sense. The information you provided is very helpful! I would be happy to contribute by adding this to the documentation if it hasn't been included yet?

oanaOM avatar Jan 28 '24 13:01 oanaOM