Issue
macOS system (Sequoia 15.7.2)
When trying to install pnpm using these methods:
https://pnpm.io/installation#on-posix-systems
or
https://pnpm.io/installation#using-npm
I got messages like below:
ERROR ENOENT: no such file or directory, mkdir '/home/<user>/.local/share/pnpm/.tools/pnpm/10.24.0_tmp_85172'
Since on my mac system /home/<user> is not my home directory, it cannot find this directory
Work Around
Do basic setup
# install the binary
npm install -g pnpm@latest-10
# run the pnpm setup
pnpm setup
This will write something like this to your .bash_profile or whatever shell config you're using
# pnpm
export PNPM_HOME="/home/<user>/.local/share/pnpm"
case ":$PATH:" in
*":$PNPM_HOME:"*) ;;
*) export PATH="$PNPM_HOME:$PATH" ;;
esac
# pnpm end
Then edit the $PNPM_HOME correctly using whatever $HOME is set to. In my case it was something like /Users/<user>
# pnpm
export PNPM_HOME="/Users/<user>/.local/share/pnpm"
case ":$PATH:" in
*":$PNPM_HOME:"*) ;;
*) export PATH="$PNPM_HOME:$PATH" ;;
esac
# pnpm end
After opening a new shell, you should be able to use pnpm