Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

node: command not found on MacOS 12 #824

Open
nulllpoint opened this issue Oct 9, 2022 · 4 comments
Open

node: command not found on MacOS 12 #824

nulllpoint opened this issue Oct 9, 2022 · 4 comments

Comments

@nulllpoint
Copy link

nulllpoint commented Oct 9, 2022

Whether it's manual installation or fnm-install.sh installation or fnm-install.sh installation, and shell-setup.

I found sample problem on #427 , but no solution found.

In addition, the directory of $FNM_MULTISHELL_PATH/bin also doesn't exist.

System is macos 12

@Schniz
Copy link
Owner

Schniz commented Oct 9, 2022

please let me know the following command outputs:

  • fnm ls
  • echo $PATH

@Schniz Schniz changed the title mac……fnm node: command not found node: command not found on MacOS 12 Oct 9, 2022
@Schniz
Copy link
Owner

Schniz commented Oct 9, 2022

also, what is the processor you have? is it M1?

@nulllpoint
Copy link
Author

please let me know the following command outputs:

  • fnm ls
  • echo $PATH

thanks for your reply, it's Intel

> fnm ls
* v14.15.1 default
* system

> echo $PATH
/Users/nullpoint/Library/Caches/fnm_multishells/54612_1665295707743/bin:/Users/nullpoint/development/sdk/fnm/1.31.1:.....

> fnm env
export PATH="/Users/nullpoint/Library/Caches/fnm_multishells/56661_1665295888335/bin":$PATH
export FNM_MULTISHELL_PATH="/Users/nullpoint/Library/Caches/fnm_multishells/56661_1665295888335"
export FNM_VERSION_FILE_STRATEGY="local"
export FNM_DIR="/Users/nullpoint/development/sdk/fnm/nodes"
export FNM_LOGLEVEL="info"
export FNM_NODE_DIST_MIRROR="https://npmmirror.com/mirrors/node"
export FNM_ARCH="x64"
rehash

> tree ~/development/sdk/fnm/nodes -L 4
/Users/nullpoint/development/sdk/fnm/nodes
├── aliases
│   └── default -> /Users/nullpoint/development/sdk/fnm/nodes/node-versions/v14.15.1/installation
└── node-versions
    └── v14.15.1
        ├── installation
        └── node-v14.15.1-darwin-x64
            ├── CHANGELOG.md
            ├── LICENSE
            ├── README.md
            ├── bin
            ├── include
            ├── lib
            └── share

@cricciuto
Copy link

@Schniz The README states:

Set a custom directory for fnm to be installed. The default is $XDG_DATA_HOME/fnm (if $XDG_DATA_HOME is not defined it falls back to $HOME/.local/share/fnm on linux and $HOME/Library/Application Support/fnm on MacOS).

But I believe this is wrong.

When I install fnm I see it gets installed to $HOME/.local/share/fnm (on my M1 MacOS machine) and not the $HOME/Library/Application Support/fnm directory.

The install automatically updates the .zshrc file with:

# fnm
FNM_PATH="/Users/myUser01/Library/Application Support/fnm"
if [ -d "$FNM_PATH" ]; then
  export PATH="/Users/myUser01/Library/Application Support/fnm:$PATH"
  eval "`fnm env`"
fi

but I changed it to:

# fnm
FNM_PATH="$HOME/.local/share/fnm"
if [ -d "$FNM_PATH" ]; then
  export PATH="$FNM_PATH:$PATH"
  eval "`fnm env`"
fi

Opened a new terminal and things started to work.
I could successfully execute:

$ node -v

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants