pnpm: macOS install error EACCES
$ pnpm install -g pnpm
ERROR EACCES: permission denied, mkdir '/usr/local/pnpm-global'
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 9
- Comments: 43 (14 by maintainers)
Commits related to this issue
- fix: update notifier should recommend using "npm i -g pnpm" ref #2579 ref #1203 — committed to pnpm/pnpm by zkochan 4 years ago
- fix: cli has no write access to the selected global dir close #1203 — committed to pnpm/pnpm by zkochan 3 years ago
- fix: cli has no write access to the selected global dir close #1203 — committed to pnpm/pnpm by zkochan 3 years ago
- fix: cli has no write access to the selected global dir (#3206) close #1203 — committed to pnpm/pnpm by zkochan 3 years ago
I started getting the following message whenever running pnpm for installs:
However, trying the recommended command resulted in the error in this issue:
So I have worked around this by manually creating the folder and taking ownership of it:
So it’s working for now. Suggest that this may be a confusing user experience for those following the notification though.
I had a similar problem.
But I’ve found a solution for this
sudo rm -rf /Users/xxx/.pnpm-store😂 and after this everything works perfectly.Just setting up a new mac, and this time I decided to install pnpm through homebrew.
Now when I try to install any global package
EDIT:
Ok got the issue, my PNPM_HOME wasn’t set correctly. Just run
pnpm setupThis is fixed in pnpm v6
I see, but it tried to write to the user directory, so seems like the fix will work.
Joel Denning notifications@github.com ezt írta (időpont: 2021. febr. 28., V 18:09):
I have version 5.5.1 and the problem is still here
For me the following solved the problem:
npm config set unsafe-perm trueand then runnpm install -g pnpmagain.I also ran into this.
Doing
npm config set prefix $HOMEhelps, but it also makes NVM stop working.See here for the related NVM issue.
This seems to work for me, the current installer
curl -f https://pnpm.js.org/pnpm.js | node - add --global pnpmthrows the same errorHowever even with the new script upgrading still throws an error
As a workaround, I can do
pnpm install -g foo --prefix $HOMEso that NVM keeps working.I think NVM is the problem here, at least in my case. I should be able to set
prefixto whatever I wish, and NVM should not complain.yes, I think pnpm should write to a folder where it has access already. There should not be any additional steps from users.