fnm icon indicating copy to clipboard operation
fnm copied to clipboard

failed to fnm exec npm in git bash

Open tiger8888 opened this issue 2 years ago • 2 comments

[~] uname -a

MINGW64_NT-10.0-17763 DESKTOP-DN5S7E6 3.3.6-bec3d608-341.x86_64 2023-02-22 08:29 UTC x86_64 Msys

[~] which npm

/c/Users/Tiger/\Users\Tiger\AppData\Local\fnm_multishells\12656_1702534701888/npm

[~] which node

/c/Users/Tiger/\Users\Tiger\AppData\Local\fnm_multishells\12656_1702534701888/node

[~] fnm exec --using=v14.21.3 node --version

v14.21.3

[~] fnm exec --using=v14.21.3 npm --version

error: Can't spawn program: program not found Maybe the program npm does not exist on not available in PATH?

[~] npm -v

6.14.18

tiger8888 avatar Dec 14 '23 06:12 tiger8888

same on msys2

Aalivexy avatar Dec 22 '23 03:12 Aalivexy

I think this issue may be related to https://github.com/Schniz/fnm/issues/390, I solved it using the following method:

# ~/.config/fish/conf.d/fnm.fish
fnm env --use-on-cd | /usr/bin/sed 1d | source;
set -gx PATH (/usr/bin/cygpath -u $FNM_MULTISHELL_PATH[2]) $PATH;

Aalivexy avatar Aug 07 '24 04:08 Aalivexy