pnpm: ERROR  No write access to the found global executable directories

i’m getting the  ERROR  No write access to the found global executable directories when running curl -f https://get.pnpm.io/v6.js | node - add --global pnpm in wsl2 node 14. Debian 10

maybe this helps

❯ ll /usr/bin/node*
-rwxr-xr-x 1 root root 73873984 Feb 23 02:00 /usr/bin/node
lrwxrwxrwx 1 root root       24 Sep 25  2020 /usr/bin/nodejs -> /etc/alternatives/nodejs

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 13
  • Comments: 30 (7 by maintainers)

Commits related to this issue

Most upvoted comments

When trying to install pnpm on the CircleCI CI/CD pipeline with the installation script:

curl -fsSL https://get.pnpm.io/install.sh | sh -

I get the following error:

 ERR_PNPM_UNSUPPORTED_SHELL  Can't setup configuration for "" shell. Supported shell languages are bash, zsh, and fish.
Install Error!

Exited with code exit status 1

Did anyone encounter this issues and found a solution already? Thanks

In case it helps anyone, what happened for us was that CircleCI most likely change the path to bash. We updated the command to pick it up automatically and set it to SHELL env var like this:

curl -fsSL https://get.pnpm.io/install.sh | SHELL=`which bash` bash -

Does the standalone script work?

curl -fsSL https://get.pnpm.io/install.sh | sh -

You should restart the terminal after running it.

v7有问题,安装包404 v6好用,怎么各种不兼容,这种东西开发出来有啥意义,糟心的很

@zkochan As mentioned by @biro456, when installing pnpm on CI, use the following command:

curl -f https://get.pnpm.io/v6.js | node - add --global pnpm

run pnpm add -g pkg, the following error will be encountered(the ~/.local/share/pnpm file has been created manually):

ERROR  The CLI has no write access to the pnpm home directory at ~/.local/share/pnpm

Use the npm install -g pnpm@7 command to install, which solves this issue.

When trying to install pnpm on the CircleCI CI/CD pipeline with the installation script:

curl -fsSL https://get.pnpm.io/install.sh | sh -

I get the following error:

 ERR_PNPM_UNSUPPORTED_SHELL  Can't setup configuration for "" shell. Supported shell languages are bash, zsh, and fish.
Install Error!

Exited with code exit status 1

Did anyone encounter this issues and found a solution already? Thanks

I install pnpm in my devcontainer with dockerfile, It happens and my solution is beyond, maybe helpful for you. The Key I think is USER and ENV, standlone script should be same

USER node
ENV SHELL="/bin/bash"
RUN sudo corepack enable && corepack prepare pnpm@latest --activate && pnpm setup

You can try to install pnpm using the standalone script https://pnpm.io/installation

curl -fsSL https://get.pnpm.io/install.sh | sh -

Why not try corepack ?

sudo corepack enable && corepack prepare pnpm@latest --activate

I was able to install pnpm on CircleCI this way.

I’m trying to install PNPM in a Docker image with this (redacted) Dockerfile:

FROM node:16-alpine
USER node:node
ENV PNPM_VERSION=6.32.9
RUN wget -qO- https://get.pnpm.io/v6.16.js | node - add -g pnpm@${PNPM_VERSION}

It fails with:

 ERROR  No write access to the found global executable directories
The found directories:
  /usr/local/bin

Building without USER node:node works, so the question is why is it failing to install when not running as root.

This should work in v7

I am having the same issue on m1. Any workarounds?

This also happens for me:

PS C:\Users\valer\OneDrive\Desktop\projects> pnpm -g list
 ERROR  The CLI has no write access to the pnpm home directory at C:\Users\valer\AppData\Local\pnpm
For help, run: pnpm help list
pnpm -v // => 6.32.3