fnm icon indicating copy to clipboard operation
fnm copied to clipboard

In Git Bash on Windows, I get a "node not recognized" error, but ONLY in postinstall scripts

Open matthew-dean opened this issue 1 year ago • 2 comments

I've been trying to debug this for a while, and haven't been able to figure it out.

FNM works fine, all the time, if I run scripts, or automate scripts, or run it from the Git Bash Windows command line.

However, if an installed package has a postinstall script, and THAT script references node, then it throws an error: 'node' is not recognized as an internal or external command, operable program or batch file.

I can't figure out a circumstance where Node is available when installing, but not to a package. Any ideas?

matthew-dean avatar Sep 07 '23 15:09 matthew-dean

Btw, I'm definitely running eval "$(fnm env --use-on-cd)" and, like I said, I can use node if I run it myself, but packages can't.

matthew-dean avatar Sep 07 '23 15:09 matthew-dean

Did you add the path corresponding to environment variable FNM_DIR(check it by running 'fnm env') to PATH?

road2coder avatar Oct 06 '23 12:10 road2coder