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

"run.sh" fails to install pnpm when not running as root #6822

Open
RalfJung opened this issue Jan 5, 2025 · 2 comments
Open

"run.sh" fails to install pnpm when not running as root #6822

RalfJung opened this issue Jan 5, 2025 · 2 comments

Comments

@RalfJung
Copy link

RalfJung commented Jan 5, 2025

Describe the bug
I am trying to update to etherpad 2.2.7 (current version is 1.9.7). Running run.sh fails with a permission error:

Jan 05 12:54:48 systemd[1]: Started etherpad-lite.service - etherpad-lite (real-time collaborative document editing).
Jan 05 12:54:49 run.sh[38599]: npm ERR! code EACCES
Jan 05 12:54:49 run.sh[38599]: npm ERR! syscall mkdir
Jan 05 12:54:49 run.sh[38599]: npm ERR! path /usr/local/lib/node_modules
Jan 05 12:54:49 run.sh[38599]: npm ERR! errno -13
Jan 05 12:54:49 run.sh[38599]: npm ERR! Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules'
Jan 05 12:54:49 run.sh[38599]: npm ERR!  [Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules'] {
Jan 05 12:54:49 run.sh[38599]: npm ERR!   errno: -13,
Jan 05 12:54:49 run.sh[38599]: npm ERR!   code: 'EACCES',
Jan 05 12:54:49 run.sh[38599]: npm ERR!   syscall: 'mkdir',
Jan 05 12:54:49 run.sh[38599]: npm ERR!   path: '/usr/local/lib/node_modules'
Jan 05 12:54:49 run.sh[38599]: npm ERR! }
Jan 05 12:54:49 run.sh[38599]: npm ERR!
Jan 05 12:54:49 run.sh[38599]: npm ERR! The operation was rejected by your operating system.
Jan 05 12:54:49 run.sh[38599]: npm ERR! It is likely you do not have the permissions to access this file as the current user

I suspect this is npm install pnpm -g failing. Apparently it tries to write to /usr. The run.sh script itself bails out when running as root, so it seems like the logic in installDeps.sh that installs pnpm doesn't seem to make a lot of sense?

To Reproduce
Steps to reproduce the behavior:

  1. Run run.sh on a system without pnpm installed.

Expected behavior
Etherpad should start up successfully.

Server (please complete the following information):

  • Etherpad version: 2.2.7
  • OS: Debian 12
  • Node.js version (node --version): v18.19.0
  • npm version (npm --version): 9.2.0

Additional context
I will definitely not run npm as root, so I am currently unsure how I could install pnpm. Somehow it should be installed only for the user that runs etherpad.

@SamTV12345
Copy link
Member

Hey. There is also some extra possibilities how to install pnpm https://pnpm.io/installation . You could use corepack for this.

@RalfJung
Copy link
Author

Is there a way to use npm install without -g and just install something for the local user? Something like pip install --local or cargo install, neither of which need root permissions.

I am not a nodejs/npm user myself so it's quite hard to figure this out based on just the etherpad docs.

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

2 participants