Updating from 3.5.3 to 4.8.1

Description

When updating from 3.5.3 to 4.8.1 I get an error:

npm ERR!    35 | #include <glib-object.h>
npm ERR!       |          ^~~~~~~~~~~~~~~

But there is no glib-object.h in any repositories.

Server Setup Information

  • Version of Rocket.Chat Server: 3.5.3 → 4.8.1
  • Operating System: Debian GNU/Linux 11 (bullseye)
  • Deployment Method: tar
  • NodeJS Version: v18.4.0
  • MongoDB Version: v4.2.20
  • npm version: v8.12.1

Hi We would need more information from logs.

Also, consider migrating to a docker deployment, as installing from tarball/manually will lead to a lot of dependencies and node version mismatch.

Using a docker deployment will get you a similar environment to most of our user base.

Hello!
The log is below, thank you!

root@x:/tmp/bundle/programs/server# sh -c "node npm-rebuild.js"
rebuilt dependencies successfully
rebuilt dependencies successfully
rebuilt dependencies successfully
rebuilt dependencies successfully
rebuilt dependencies successfully
npm ERR! code 1
npm ERR! path /tmp/bundle/programs/server/npm/node_modules/sharp
npm ERR! command failed
npm ERR! command sh -c (node install/libvips && node install/dll-copy && prebuild-install) || (node install/can-compile && node-gyp rebuild && node install/dll-copy)
npm ERR! sharp: Using existing vendored libvips v8.12.2
npm ERR! make: Entering directory «/tmp/bundle/programs/server/npm/node_modules/sharp/build»
npm ERR!   TOUCH Release/obj.target/libvips-cpp.stamp
npm ERR!   CC(target) Release/obj.target/nothing/node_modules/node-addon-api/nothing.o
npm ERR!   AR(target) Release/obj.target/node_modules/node-addon-api/nothing.a
npm ERR!   COPY Release/nothing.a
npm ERR!   CXX(target) Release/obj.target/sharp-linux-x64/src/common.o
npm ERR! make: Leaving directory «/tmp/bundle/programs/server/npm/node_modules/sharp/build»
npm ERR! prebuild-install WARN install EACCES: permission denied, access '/root/.npm'
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@8.0.0
npm ERR! gyp info using node@18.4.0 | linux | x64
npm ERR! gyp info find Python using Python version 3.9.2 found at "/usr/bin/python3"
npm ERR! gyp WARN EACCES current user ("apiextension") does not have permission to access the dev dir "/root/.cache/node-gyp/18.4.0"
npm ERR! gyp WARN EACCES attempting to reinstall using temporary dev dir "/tmp/.node-gyp"
npm ERR! gyp http GET https://nodejs.org/download/release/v18.4.0/node-v18.4.0-headers.tar.gz
npm ERR! gyp http 200 https://nodejs.org/download/release/v18.4.0/node-v18.4.0-headers.tar.gz
npm ERR! gyp http GET https://nodejs.org/download/release/v18.4.0/SHASUMS256.txt
npm ERR! gyp http 200 https://nodejs.org/download/release/v18.4.0/SHASUMS256.txt
npm ERR! (node:99742) [DEP0150] DeprecationWarning: Setting process.config is deprecated. In the future the property will be read-only.
npm ERR! (Use `node --trace-deprecation ...` to show where the warning was created)
npm ERR! gyp info spawn /usr/bin/python3
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args   '/tmp/bundle/programs/server/node_modules/node-gyp/gyp/gyp_main.py',
npm ERR! gyp info spawn args   'binding.gyp',
npm ERR! gyp info spawn args   '-f',
npm ERR! gyp info spawn args   'make',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/tmp/bundle/programs/server/npm/node_modules/sharp/build/config.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/tmp/bundle/programs/server/node_modules/node-gyp/addon.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/tmp/.node-gyp/18.4.0/include/node/common.gypi',
npm ERR! gyp info spawn args   '-Dlibrary=shared_library',
npm ERR! gyp info spawn args   '-Dvisibility=default',
npm ERR! gyp info spawn args   '-Dnode_root_dir=/tmp/.node-gyp/18.4.0',
npm ERR! gyp info spawn args   '-Dnode_gyp_dir=/tmp/bundle/programs/server/node_modules/node-gyp',
npm ERR! gyp info spawn args   '-Dnode_lib_file=/tmp/.node-gyp/18.4.0/<(target_arch)/node.lib',
npm ERR! gyp info spawn args   '-Dmodule_root_dir=/tmp/bundle/programs/server/npm/node_modules/sharp',
npm ERR! gyp info spawn args   '-Dnode_engine=v8',
npm ERR! gyp info spawn args   '--depth=.',
npm ERR! gyp info spawn args   '--no-parallel',
npm ERR! gyp info spawn args   '--generator-output',
npm ERR! gyp info spawn args   'build',
npm ERR! gyp info spawn args   '-Goutput_dir=.'
npm ERR! gyp info spawn args ]
npm ERR! gyp info spawn make
npm ERR! gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
npm ERR! In file included from ../src/common.cc:24:
npm ERR! /usr/include/vips/vips8:35:10: fatal error: glib-object.h: No such file or directory
npm ERR!    35 | #include <glib-object.h>
npm ERR!       |          ^~~~~~~~~~~~~~~
npm ERR! compilation terminated.
npm ERR! make: *** [sharp-linux-x64.target.mk:139: Release/obj.target/sharp-linux-x64/src/common.o] Exit 1
npm ERR! gyp ERR! build error 
npm ERR! gyp ERR! stack Error: `make` failed with exit code: 2
npm ERR! gyp ERR! stack     at ChildProcess.onExit (/tmp/bundle/programs/server/node_modules/node-gyp/lib/build.js:194:23)
npm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:537:28)
npm ERR! gyp ERR! stack     at ChildProcess._handle.onexit (node:internal/child_process:291:12)
npm ERR! gyp ERR! System Linux 5.10.0-14-amd64
npm ERR! gyp ERR! command "/usr/bin/node" "/tmp/bundle/programs/server/node_modules/.bin/node-gyp" "rebuild"
npm ERR! gyp ERR! cwd /tmp/bundle/programs/server/npm/node_modules/sharp
npm ERR! gyp ERR! node -v v18.4.0
npm ERR! gyp ERR! node-gyp -v v8.0.0
npm ERR! gyp ERR! not ok

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2022-07-05T13_20_01_870Z-debug-0.log