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

4.2.0->4.2.1 upgrade fails on Ubuntu 18.4.6 LTS with npm 8.1.2 node 16.13.1 fails with a sharp build error #23931

Closed
corrigac opened this issue Dec 13, 2021 · 19 comments

Comments

@corrigac
Copy link

Description:

roctetchatctl update from 4.2.0 to 4.2.1 on Ubuntu 18.4.6 LTS with npm 8.1.2/node 16.13.1 fails with a sharp build error

Steps to reproduce:

  1. Install rocketchat 4.2.0 on Ubuntu 18.4.6 with rocketchatctl / restore from snapshot
  2. run rocketchatctl update

Expected behavior:

expected clean update to 4.2.1, or at least a roll back to existing version

Actual behavior:

rocketchat service left in a failed state

Server Setup Information:

Client Setup Information

  • Desktop App or Browser Version: Electron app
  • Operating System: macos / windows

Additional context

update command output:
$ sudo rocketchatctl update
Updates could be risky, you can use the backup option # rocketchatctl backup, to create a backup of the rocketchat database first. Please check that you have enough space in your system to store the backup.
Current update available for RocketChat server: from 4.2 to 4.2.1.
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 132 100 132 0 0 320 0 --:--:-- --:--:-- --:--:-- 319
100 159M 100 159M 0 0 156M 0 0:00:01 0:00:01 --:--:-- 156M
npm WARN old lockfile
npm WARN old lockfile The npm-shrinkwrap.json file was created with an old version of npm,
npm WARN old lockfile so supplemental metadata must be fetched from the registry.
npm WARN old lockfile
npm WARN old lockfile This is a one-time fix-up, please be patient...
npm WARN old lockfile
npm WARN deprecated [email protected]: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.
npm WARN deprecated [email protected]: this library is no longer supported
npm WARN deprecated [email protected]: request has been deprecated, see request/request#3142
npm WARN deprecated [email protected]: Please upgrade to @mapbox/node-pre-gyp: the non-scoped node-pre-gyp package is deprecated and only the @mapbox scoped package will recieve updates in the future

install
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.11.3
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! sharp-linux-x64.target.mk:139: recipe for target 'Release/obj.target/sharp-linux-x64/src/common.o' failed
npm ERR! make: Leaving directory '/tmp/bundle/programs/server/npm/node_modules/sharp/build'
npm ERR! prebuild-install WARN install EACCES: permission denied, access '/home/ubuntu/.npm'
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using [email protected]
npm ERR! gyp info using [email protected] | linux | x64
npm ERR! gyp info find Python using Python version 3.6.9 found at "/usr/bin/python3"
npm ERR! gyp WARN EACCES current user ("rocketchat") does not have permission to access the dev dir "/home/ubuntu/.cache/node-gyp/16.13.1"
npm ERR! gyp WARN EACCES attempting to reinstall using temporary dev dir "/tmp/.node-gyp"
npm ERR! (node:2420) [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/16.13.1/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/16.13.1',
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/16.13.1/<(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! ../src/common.cc:24:10: fatal error: vips/vips8: No such file or directory
npm ERR! #include <vips/vips8>
npm ERR! ^~~~~~~~~~~~
npm ERR! compilation terminated.
npm ERR! make: *** [Release/obj.target/sharp-linux-x64/src/common.o] Error 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:390:28)
npm ERR! gyp ERR! stack at Process.ChildProcess._handle.onexit (node:internal/child_process:290:12)
npm ERR! gyp ERR! System Linux 5.4.0-1060-aws
npm ERR! gyp ERR! command "/usr/local/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 v16.13.1
npm ERR! gyp ERR! node-gyp -v v6.0.1
npm ERR! gyp ERR! not ok
npm ERR! code 1
npm ERR! path /tmp/bundle/programs/server
npm ERR! command failed
npm ERR! command sh -c node npm-rebuild.js

npm ERR! A complete log of this run can be found in:
npm ERR! /home/ubuntu/.npm/_logs/2021-12-13T11_08_28_202Z-debug.log
Waiting up to 5 minutes for RocketChat server to be active ... 2
RocketChat server not running. Cancelling

Attempted recommended remediations

#1 - go to latest node/npm via sudo npm cache clean -f; sudo npm install -g n; sudo n stable;
#2 - sudo npm install --unsafe-perm --ignore-scripts=false --platform=linux --arch=x64 sharp

Relevant logs:

/var/log/syslog
Dec 13 10:34:47 chat rocketchat[1242]: {"level":51,"time":"2021-12-13T10:34:47.487Z","pid":1242,"hostname":"REDACTED","name":"Migrations","msg":"Not migrating, already at version 249"}
Dec 13 10:34:47 chat rocketchat[1242]: ufs: temp directory created at "/tmp/ufs"
Dec 13 10:34:48 chat rocketchat[1242]: Loaded the Apps Framework and loaded a total of 0 Apps!
Dec 13 10:34:48 chat rocketchat[1242]: +------------------------------------------------------------+
Dec 13 10:34:48 chat rocketchat[1242]: | SERVER RUNNING |
Dec 13 10:34:48 chat rocketchat[1242]: +------------------------------------------------------------+
Dec 13 10:34:48 chat rocketchat[1242]: | |
Dec 13 10:34:48 chat rocketchat[1242]: | Rocket.Chat Version: 4.2.0 |
Dec 13 10:34:48 chat rocketchat[1242]: | NodeJS Version: 12.18.4 - x64 |
Dec 13 10:34:48 chat rocketchat[1242]: | MongoDB Version: 4.2.17 |
Dec 13 10:34:48 chat rocketchat[1242]: | MongoDB Engine: wiredTiger |
Dec 13 10:34:48 chat rocketchat[1242]: | Platform: linux |
Dec 13 10:34:48 chat rocketchat[1242]: | Process Port: 3000 |
Dec 13 10:34:48 chat rocketchat[1242]: | Site URL: https://REDACTED |
Dec 13 10:34:48 chat rocketchat[1242]: | ReplicaSet OpLog: Enabled |
Dec 13 10:34:48 chat rocketchat[1242]: | Commit Hash: a4ad199 |
Dec 13 10:34:48 chat rocketchat[1242]: | Commit Branch: HEAD |
Dec 13 10:34:48 chat rocketchat[1242]: | |
Dec 13 10:34:48 chat rocketchat[1242]: +------------------------------------------------------------+
Dec 13 10:39:10 chat dbus-daemon[897]: [system] Activating via systemd: service name='org.freedesktop.timedate1' unit='dbus-org.freedesktop.timedate1.service' requested by ':1.9' (uid=0 pid=895 comm="/usr/lib/snapd/snapd " label="unconfined")
Dec 13 10:39:10 chat systemd[1]: Starting Time & Date Service...
Dec 13 10:39:10 chat dbus-daemon[897]: [system] Successfully activated service 'org.freedesktop.timedate1'
Dec 13 10:39:10 chat systemd[1]: Started Time & Date Service.
Dec 13 10:48:59 chat systemd[1]: Starting Cleanup of Temporary Directories...
Dec 13 10:48:59 chat systemd[1]: Started Cleanup of Temporary Directories.
Dec 13 10:49:59 chat systemd[1]: Starting Message of the Day...
Dec 13 10:50:17 chat 50-motd-news[1478]: * Ubuntu Pro delivers the most comprehensive open source security and
Dec 13 10:50:17 chat 50-motd-news[1478]: compliance features.
Dec 13 10:50:17 chat 50-motd-news[1478]: https://ubuntu.com/aws/pro
Dec 13 10:50:17 chat systemd[1]: Started Message of the Day.
Dec 13 11:03:42 chat systemd[1]: Created slice User Slice of ubuntu.
Dec 13 11:03:42 chat systemd[1]: Starting User Manager for UID 1000...
Dec 13 11:03:42 chat systemd[1]: Started Session 1 of user ubuntu.
Dec 13 11:03:42 chat systemd[1572]: Listening on GnuPG network certificate management daemon.
Dec 13 11:03:42 chat systemd[1572]: Listening on GnuPG cryptographic agent and passphrase cache.
Dec 13 11:03:42 chat systemd[1572]: Listening on GnuPG cryptographic agent (ssh-agent emulation).
Dec 13 11:03:42 chat systemd[1572]: Listening on GnuPG cryptographic agent and passphrase cache (restricted).
Dec 13 11:03:42 chat systemd[1572]: Listening on REST API socket for snapd user session agent.
Dec 13 11:03:42 chat systemd[1572]: Reached target Paths.
Dec 13 11:03:42 chat systemd[1572]: Listening on GnuPG cryptographic agent and passphrase cache (access for web browsers).
Dec 13 11:03:42 chat systemd[1572]: Reached target Sockets.
Dec 13 11:03:42 chat systemd[1572]: Reached target Timers.
Dec 13 11:03:42 chat systemd[1572]: Reached target Basic System.
Dec 13 11:03:42 chat systemd[1572]: Reached target Default.
Dec 13 11:03:42 chat systemd[1572]: Startup finished in 55ms.
Dec 13 11:03:42 chat systemd[1]: Started User Manager for UID 1000.
Dec 13 11:04:03 chat systemd-networkd[707]: ens5: Configured
Dec 13 11:04:03 chat systemd-timesyncd[621]: Network configuration changed, trying to establish connection.
Dec 13 11:04:03 chat systemd-timesyncd[621]: Synchronized to time server 91.189.94.4:123 (ntp.ubuntu.com).
Dec 13 11:07:54 chat systemd[1]: Stopping The Rocket.Chat server...
Dec 13 11:07:54 chat systemd[1]: Stopped The Rocket.Chat server.
Dec 13 11:08:28 chat systemd[1]: Starting The Rocket.Chat server...
Dec 13 11:08:48 chat systemd[1]: Started The Rocket.Chat server.
Dec 13 11:08:49 chat rocketchat[2639]: node: ../src/coroutine.cc:134: void* find_thread_id_key(void*): Assertion thread_id_key != 0x7777' failed. Dec 13 11:08:49 chat systemd[1]: rocketchat.service: Main process exited, code=killed, status=6/ABRT Dec 13 11:08:49 chat systemd[1]: rocketchat.service: Failed with result 'signal'. Dec 13 11:09:42 chat systemd[1]: Started Session 3 of user ubuntu. Dec 13 11:10:31 chat systemd[1]: Starting The Rocket.Chat server... Dec 13 11:10:51 chat systemd[1]: Started The Rocket.Chat server. Dec 13 11:10:51 chat rocketchat[2805]: ## There is an issue with node-fibers## Dec 13 11:10:51 chat rocketchat[2805]:/opt/Rocket.Chat/programs/server/node_modules/fibers/bin/linux-x64-93-glibc/fibers.node` is missing.
Dec 13 11:10:51 chat rocketchat[2805]: Try running this to fix the issue: /usr/local/bin/node /opt/Rocket.Chat/programs/server/node_modules/fibers/build
Dec 13 11:10:51 chat rocketchat[2805]: Error: Cannot find module '/opt/Rocket.Chat/programs/server/node_modules/fibers/bin/linux-x64-93-glibc/fibers'
Dec 13 11:10:51 chat rocketchat[2805]: Require stack:
Dec 13 11:10:51 chat rocketchat[2805]: - /opt/Rocket.Chat/programs/server/node_modules/fibers/fibers.js
Dec 13 11:10:51 chat rocketchat[2805]: - /opt/Rocket.Chat/programs/server/boot.js
Dec 13 11:10:51 chat rocketchat[2805]: - /opt/Rocket.Chat/main.js
Dec 13 11:10:51 chat rocketchat[2805]: at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
Dec 13 11:10:51 chat rocketchat[2805]: at Function.Module._load (node:internal/modules/cjs/loader:778:27)
Dec 13 11:10:51 chat rocketchat[2805]: at Module.require (node:internal/modules/cjs/loader:1005:19)
Dec 13 11:10:51 chat rocketchat[2805]: at require (node:internal/modules/cjs/helpers:102:18)
Dec 13 11:10:51 chat rocketchat[2805]: at Object. (/opt/Rocket.Chat/programs/server/node_modules/fibers/fibers.js:14:39)
Dec 13 11:10:51 chat rocketchat[2805]: at Module._compile (node:internal/modules/cjs/loader:1101:14)
Dec 13 11:10:51 chat rocketchat[2805]: at Module.Mp._compile (/opt/Rocket.Chat/programs/server/runtime.js:50:23)
Dec 13 11:10:51 chat rocketchat[2805]: at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
Dec 13 11:10:51 chat rocketchat[2805]: at Module.load (node:internal/modules/cjs/loader:981:32)
Dec 13 11:10:51 chat rocketchat[2805]: at Module.Mp.load (/opt/Rocket.Chat/programs/server/runtime.js:15:31)
Dec 13 11:10:51 chat rocketchat[2805]: /opt/Rocket.Chat/programs/server/node_modules/fibers/fibers.js:23
Dec 13 11:10:51 chat rocketchat[2805]: #11#011throw new Error('Missing binary. See message above.');
Dec 13 11:10:51 chat rocketchat[2805]: #11#011^
Dec 13 11:10:51 chat rocketchat[2805]: Error: Missing binary. See message above.
Dec 13 11:10:51 chat rocketchat[2805]: at Object. (/opt/Rocket.Chat/programs/server/node_modules/fibers/fibers.js:23:9)
Dec 13 11:10:51 chat rocketchat[2805]: at Module._compile (node:internal/modules/cjs/loader:1101:14)
Dec 13 11:10:51 chat rocketchat[2805]: at Module.Mp._compile (/opt/Rocket.Chat/programs/server/runtime.js:50:23)
Dec 13 11:10:51 chat rocketchat[2805]: at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
Dec 13 11:10:51 chat rocketchat[2805]: at Module.load (node:internal/modules/cjs/loader:981:32)
Dec 13 11:10:51 chat rocketchat[2805]: at Module.Mp.load (/opt/Rocket.Chat/programs/server/runtime.js:15:31)
Dec 13 11:10:51 chat rocketchat[2805]: at Function.Module._load (node:internal/modules/cjs/loader:822:12)
Dec 13 11:10:51 chat rocketchat[2805]: at Module.require (node:internal/modules/cjs/loader:1005:19)
Dec 13 11:10:51 chat rocketchat[2805]: at require (node:internal/modules/cjs/helpers:102:18)
Dec 13 11:10:51 chat rocketchat[2805]: at Object. (/opt/Rocket.Chat/programs/server/boot.js:2:15)
Dec 13 11:10:51 chat systemd[1]: rocketchat.service: Main process exited, code=exited, status=1/FAILURE
Dec 13 11:10:51 chat systemd[1]: rocketchat.service: Failed with result 'exit-code'.
Dec 13 11:17:01 chat CRON[2863]: (root) CMD ( cd / && run-parts --report /etc/cron.hourly)

@TimmiORG
Copy link

Similar issue for me on Rocky Linux 8 and installation from tgz file.
4.2.0 is compiling without issues.

@debdutdeb
Copy link
Member

Hi, you need node 12 to successfully build rocketchat.

@TimmiORG
Copy link

Hi, you need node 12 to successfully build rocketchat.

I using 12.20.1 and it is also not working for me.

@debdutdeb
Copy link
Member

Logs?

@TimmiORG
Copy link

TimmiORG commented Dec 13, 2021

Logs?

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.11.3
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 [email protected]
npm ERR! gyp info using [email protected] | linux | x64
npm ERR! gyp info find Python using Python version 3.6.8 found at "/usr/bin/python3"
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/12.20.1/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/12.20.1',
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/12.20.1/<(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! ../src/common.cc:24:10: fatal error: vips/vips8: No such file or directory
npm ERR!  #include <vips/vips8>
npm ERR!           ^~~~~~~~~~~~
npm ERR! compilation terminated.
npm ERR! make: *** [sharp-linux-x64.target.mk:139: Release/obj.target/sharp-linux-x64/src/common.o] Error 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 (events.js:314:20)
npm ERR! gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:276:12)
npm ERR! gyp ERR! System Linux 4.18.0-348.2.1.el8_5.x86_64
npm ERR! gyp ERR! command "/usr/local/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 v12.20.1
npm ERR! gyp ERR! node-gyp -v v6.0.1
npm ERR! gyp ERR! not ok

npm ERR! A complete log of this run can be found in:
npm ERR! code 1
npm ERR! path /tmp/bundle/programs/server
npm ERR! command failed
npm ERR! command sh -c node npm-rebuild.js

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2021-12-13T12_40_15_847Z-debug-0.```

@debdutdeb
Copy link
Member

What command did you use? Was it on rocketchatctl?

@TimmiORG
Copy link

What command did you use? Was it on rocketchatctl?
No I'm using "cd /tmp/bundle/programs/server && npm install"

@TimmiORG
Copy link

This is how I did it until 4.2.0 without issues. With 4.2.1 it is not working for me anymore.

@debdutdeb
Copy link
Member

Under the root user?

@TimmiORG
Copy link

Under the root user?

yes

@debdutdeb
Copy link
Member

Run npm i --unsafe-perm instead

@TimmiORG
Copy link

Run npm i --unsafe-perm instead

same for me

@magenbrot
Copy link

same here on Debian Buster with node v12.22.7.

After installing the package libvips-dev the error changes to:

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!  #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] Error 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 (events.js:314:20)
npm ERR! gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:276:12)
npm ERR! gyp ERR! System Linux 4.19.0-17-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 v12.22.7
npm ERR! gyp ERR! node-gyp -v v6.0.1
npm ERR! gyp ERR! not ok

@corrigac
Copy link
Author

Upgrade from 4.0.0->4.2.2 working without issue, will try 4.2.0->4.2.2 shortly

@pmhristov
Copy link

pmhristov commented Dec 16, 2021

Using CentOS 8, nothing after 4.2.0 works for me.

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.11.3
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 [email protected]
npm ERR! gyp info using [email protected] | linux | x64
npm ERR! gyp info find Python using Python version 3.6.8 found at "/usr/bin/python3"
npm ERR! gyp WARN EACCES current user does not have permission to access the dev dir "/root/.cache/node-gyp/12.18.4"
npm ERR! gyp WARN EACCES attempting to reinstall using temporary dev dir "/tmp/.node-gyp"
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/12.18.4/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/12.18.4',
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/12.18.4/<(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! ../src/common.cc:24:10: fatal error: vips/vips8: No such file or directory
npm ERR!  #include <vips/vips8>
npm ERR!           ^~~~~~~~~~~~
npm ERR! compilation terminated.
npm ERR! make: *** [sharp-linux-x64.target.mk:139: Release/obj.target/sharp-linux-x64/src/common.o] Error 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 (events.js:315:20)
npm ERR! gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
npm ERR! gyp ERR! System Linux 4.18.0-348.2.1.el8_5.x86_64
npm ERR! gyp ERR! command "/usr/local/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 v12.18.4
npm ERR! gyp ERR! node-gyp -v v6.0.1
npm ERR! gyp ERR! not ok
npm ERR! code 1
npm ERR! path /tmp/bundle/programs/server
npm ERR! command failed
npm ERR! command sh -c node npm-rebuild.js

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2021-12-16T08_50_20_829Z-debug.log
  npm: '7.19.1',
  node: '12.18.4',
  v8: '7.8.279.23-node.39',
  uv: '1.38.0',
  zlib: '1.2.11',
  brotli: '1.0.7',
  ares: '1.16.0',
  modules: '72',
  nghttp2: '1.41.0',
  napi: '6',
  llhttp: '2.1.2',
  http_parser: '2.9.3',
  openssl: '1.1.1g',
  cldr: '37.0',
  icu: '67.1',
  tz: '2019c',
  unicode: '13.0'
}

@mranderson56
Copy link

Hello,
You need to update "node" in the last version supported by Rocket.Chat :
sudo n install 12.22.1

-> https://docs.rocket.chat/quick-start/installing-and-updating/manual-installation/updating

@TimmiORG
Copy link

Hello, You need to update "node" in the last version supported by Rocket.Chat : sudo n install 12.22.1

-> https://docs.rocket.chat/quick-start/installing-and-updating/manual-installation/updating

@mranderson56
Thank you this hint. Solved my issue to update to > 4.2.0

@corrigac
Copy link
Author

Works for me 4.2.0 -> 4.3.0

@vidlb
Copy link

vidlb commented Jan 13, 2022

Trying to update from 4.1.0 to 4.3.1 (non-docker ubuntu installation) and I also see this sharp build error related to libvips.
npm ERR! ../src/common.cc:24:10: fatal error: vips/vips8: No such file or directory
Is there another way than installing libvips-dev (since it requires a lot of dependencies when installing with apt...)

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

7 participants