fnm env --use-on-cd --shell bash

Category: Node.js & npm/yarn

fnm env --use-on-cd --shell bash

Set up fnm shell integration

Emits the shell code that configures PATH for fnm, with --use-on-cd switching Node automatically when you enter a directory that declares a version. Wrap it in eval in .bashrc, for example eval "$(fnm env --use-on-cd --shell bash)". The --shell flag avoids detection issues.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.