Skip to content

npm/node is not found in the first shell opened #1449

@willparsons

Description

@willparsons

Whenever I first open my terminal npm and node cannot be found. I have to start a new shell.

System:

  • fish 4.0.2
  • fnm 1.38.1
  • WSL Ubuntu 24.04.2

Fish config:

# conf.d/fnm.fish
if status is-interactive
    fish_add_path -a "/home/will/.local/share/fnm"
    fnm env --shell fish | source
    fnm completions --shell fish | source
end

# config.fish
if status is-interactive
    # Commands to run in interactive sessions can go here
end

abbr --add ch chezmoi
abbr --add lg lazygit

fish_add_path -a /opt/nvim/bin

direnv hook fish | source
starship init fish | source

~
❯ npm
Command 'npm' not found, but can be installed with:
sudo apt install npm

~
❯ fnm env
set -gx PATH "/run/user/1000/fnm_multishells/1078_1752221320327/bin" $PATH;
set -gx FNM_MULTISHELL_PATH "/run/user/1000/fnm_multishells/1078_1752221320327";
set -gx FNM_VERSION_FILE_STRATEGY "local";
set -gx FNM_DIR "/home/will/.local/share/fnm";
set -gx FNM_LOGLEVEL "info";
set -gx FNM_NODE_DIST_MIRROR "https://nodejs.org/dist";
set -gx FNM_COREPACK_ENABLED "false";
set -gx FNM_RESOLVE_ENGINES "true";
set -gx FNM_ARCH "x64";

~echo $PATH
/run/user/1000/fnm_multishells/794_1752221314420/bin /home/will/.local/share/fnm

~
❯ ls /run/user/1000/fnm_multishells
1078_1752221320327@  883_1752221314920@

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions