Error when installation rocket.chat on Ubuntu Server 24

Description

I am following these instructions:
https://docs.rocket.chat/docs/deploy-with-ubuntu
I get to this step:
cd /tmp/bundle/programs/server && npm install --production

I receive this error:

npm ERR! code EACCES
npm ERR! syscall open
npm ERR! path /tmp/bundle/programs/server/npm-shrinkwrap.json
npm ERR! errno -13
npm ERR! Error: EACCES: permission denied, open ‘/tmp/bundle/programs/server/npm-shrinkwrap.json’
npm ERR! [Error: EACCES: permission denied, open ‘/tmp/bundle/programs/server/npm-shrinkwrap.json’] {
npm ERR! errno: -13,
npm ERR! code: ‘EACCES’,
npm ERR! syscall: ‘open’,
npm ERR! path: ‘/tmp/bundle/programs/server/npm-shrinkwrap.json’
npm ERR! }
npm ERR!
npm ERR! The operation was rejected by your operating system.
npm ERR! It is likely you do not have the permissions to access this file as the current user
npm ERR!
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator.

npm ERR! A complete log of this run can be found in:
npm ERR! /home/stevep/.npm/_logs/2024-09-18T03_36_59_754Z-debug-0.log

Server Setup Information

  • Version of Rocket.Chat Server: 6.12
  • Operating System: ubuntu 24.04.01 LTS
  • Deployment Method: tar
  • Number of Running Instances: 0 for now, trying to install first 1
  • DB Replicaset Oplog:
  • NodeJS Version: 18.19.1
  • MongoDB Version: 7.0
  • Proxy: none
  • Firewalls involved: no

Any additional Information

Guide I am following:
https://docs.rocket.chat/docs/deploy-with-ubuntu

Try " npm install --unsafe-perm --production "

Please read the release notes thoroughly.

Engine versions
Node: 14.21.3
MongoDB: 4.4, 5.0, 6.0

Note also that this is not technically supported currently.

Probably will be on Rocket v7.

Again, read the notes and see the required version above.

You also need to make sure that (if required eg dev builds) you run meteor 2.6, but the current install file will give you meteor 3.02

Note the above error.

You probably need to get your permission ducks in a row.

And if you aren’t trying to develop code you will likely find life much easier using snaps or docker. :slight_smile:

Last, for any form of production, use https and a reverse proxy. Always.

1 Like

I had tried this earlier and just tried it again at your suggestion.

It results in the same error message.

reetp-

Before I attempt to back grade and break a lot of thing on this system, are you saying my permission error is related to running node v18.19.1 and MongoDB version 7.0? I did change to /tmp/bundle/programs/server.

then issued this command : chown -R stevep:stevep *

I am logged in as stevep. There were no errors or files it could not change ownership.

This command failed again due to permissions: npm install --unsafe-perm --production
(same error).

I appreciate your reply but I think I have learned that this package has dependencies on old packages. Is that correct?

Also, is there an alternate method of installing other than npm?

I was able to install successfully using docker in a test environment.

You will - downgrades are not supported due to upgrades within the Mongo DB structure with version changes. Restore from backup to the same version that was used for the backup is the only reasonably guaranteed option.

Some people do roll back - YMMV.

The other thing to check on ubuntu is apparmor. I think they are a lot stricter on 24.x than 22.x

Beyond that I don’t know.

You should do a lot more reading to understand this. There are plenty of topics on it eg

I did say:

Precisely.