§2024-08-18
- install requirements
sudo apt install -y curl build-essential graphicsmagick
$ cd build/src
$ wget https://github.com/RocketChat/Rocket.Chat/archive/refs/tags/6.11.1.tar.gz
$ ls
6.11.1.tar.gz mongodb-org-server_7.0.12_arm64.deb rocket.chat.tgz
$ tar -xzvf ~/build/src/6.11.1.tar.gz -C ~/build/
$ ls ~/build/
Rocket.Chat-6.11.1 src
- Move the extracted files to the /opt directory.
$ sudo mv ~/build/ /opt/Rocket.Chat
$ ls -l /opt/
total 4
drwxr-xr-x 4 alexlai alexlai 4096 Aug 16 09:47 Rocket.Chat
drwxr-xr-x 3 root root 21 Aug 18 14:35 xfs
3.1 npm install
root@hc4Noble:/home/alexlai# cd /opt/Rocket.Chat/programs/server/
root@hc4Noble:/opt/Rocket.Chat/programs/server# npm install
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 osenv@0.1.5: This package is no longer supported.
npm warn deprecated @npmcli/move-file@1.1.2: This functionality has been moved to @npmcli/fs
npm warn deprecated inflight@1.0.6: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.
npm warn deprecated rimraf@2.7.1: Rimraf versions prior to v4 are no longer supported
npm warn deprecated npmlog@4.1.2: This package is no longer supported.
npm warn deprecated rimraf@3.0.2: Rimraf versions prior to v4 are no longer supported
npm warn deprecated are-we-there-yet@1.1.7: This package is no longer supported.
npm warn deprecated acorn-dynamic-import@4.0.0: This is probably built in to whatever tool you're using. If you still need it... idk
npm warn deprecated glob@7.2.3: Glob versions prior to v9 are no longer supported
npm warn deprecated sourcemap-codec@1.4.8: Please use @jridgewell/sourcemap-codec instead
npm warn deprecated gauge@2.7.4: This package is no longer supported.
npm warn deprecated node-pre-gyp@0.15.0: 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
npm error code 127
npm error path /opt/Rocket.Chat/programs/server/node_modules/fibers
npm error command failed
npm error command sh -c node build.js || nodejs build.js
npm error gyp info it worked if it ends with ok
npm error gyp info using node-gyp@8.0.0
npm error gyp info using node@22.6.0 | linux | arm64
npm error (node:1870) [DEP0060] DeprecationWarning: The `util._extend` API is deprecated. Please use Object.assign() instead.
npm error (Use `node --trace-deprecation ...` to show where the warning was created)
npm error gyp info find Python using Python version 3.12.3 found at "/usr/bin/python3"
npm error gyp ERR! UNCAUGHT EXCEPTION
npm error gyp ERR! stack TypeError: Cannot assign to read only property 'cflags' of object '#<Object>'
npm error gyp ERR! stack at createConfigFile (/opt/Rocket.Chat/programs/server/node_modules/node-gyp/lib/configure.js:117:21)
npm error gyp ERR! stack at /opt/Rocket.Chat/programs/server/node_modules/node-gyp/lib/configure.js:84:9
npm error gyp ERR! stack at FSReqCallback.oncomplete (node:fs:187:23)
npm error gyp ERR! System Linux 6.6.0-odroid-arm64
npm error gyp ERR! command "/home/alexlai/.local/share/fnm/node-versions/v22.6.0/installation/bin/node" "/opt/Rocket.Chat/programs/server/node_modules/.bin/node-gyp" "rebuild" "--release"
npm error gyp ERR! cwd /opt/Rocket.Chat/programs/server/node_modules/fibers
npm error gyp ERR! node -v v22.6.0
npm error gyp ERR! node-gyp -v v8.0.0
npm error gyp ERR! Node-gyp failed to build your package.
npm error gyp ERR! Try to update npm and/or node-gyp and if it does not help file an issue with the package author.
npm error node-gyp exited with code: 7
npm error Please make sure you are using a supported platform and node version. If you
npm error would like to compile fibers on this machine please make sure you have setup your
npm error build environment--
npm error Windows + OS X instructions here: https://github.com/nodejs/node-gyp
npm error Ubuntu users please run: `sudo apt-get install g++ build-essential`
npm error RHEL users please run: `yum install gcc-c++` and `yum groupinstall 'Development Tools'`
npm error Alpine users please run: `sudo apk add python make g++`
npm error sh: 1: nodejs: not found
npm error A complete log of this run can be found in: /root/.npm/_logs/2024-08-18T11_31_22_541Z-debug-0.log
root@hc4Noble:/opt/Rocket.Chat/programs/server#
- Configure the Rocket.Chat service
Add the rocketchat user and set the right permissions on the Rocket.Chat folder.
alexlai@hc4Noble:~$ sudo useradd -M rocketchat && sudo usermod -L rocketchat # -L lock user account
alexlai@hc4Noble:~$ id rocketchat
uid=1027(rocketchat) gid=1027(rocketchat) groups=1027(rocketchat)
lexlai@hc4Noble:~$ sudo usermod -aG alexlai rocketchat #--> to excute node
alexlai@hc4Noble:~$ id rocketchat
uid=1027(rocketchat) gid=1027(rocketchat) groups=1027(rocketchat),1026(alexlai)
usrmod -L
This prevents the user from logging in by disabling their password.
- chang ownership of /opt/Rocket.Chat
alexlai@hc4Noble:~$ sudo chown -R rocketchat:rocketchat /opt/Rocket.Chat
alexlai@hc4Noble:~$ ls -l /opt/Rocket.Chat/
total 20
-r--r--r-- 1 rocketchat rocketchat 243 Aug 16 09:47 main.js
drwxr-xr-x 5 rocketchat rocketchat 4096 Aug 16 09:47 programs
-r--r--r-- 1 rocketchat rocketchat 535 Aug 16 09:47 README
drwxr-xr-x 2 rocketchat rocketchat 4096 Aug 16 09:47 server
-r--r--r-- 1 rocketchat rocketchat 602 Aug 16 09:47 star.json
-
I did install node in /usr/bin skip setting
NODE_PATH=$(which node)
-
/etc/systemd/system/rocketchat.service
[Unit]
Description=The Rocket.Chat server
After=network.target remote-fs.target nss-lookup.target nginx.service mongod.service
[Service]
ExecStart=node /opt/Rocket.Chat/main.js
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=rocketchat
User=rocketchat
Environment=MONGO_URL=mongodb://localhost:27017/rocketchat?replicaSet=rs01
MONGO_OPLOG_URL=mongodb://localhost:27017/local?replicaSet=rs01
ROOT_URL=http://localhost:3000/ PORT=3000
[Install]
WantedBy=multi-user.target
npm run postinstall
root@hc4Noble:/home/alexlai# mkdir -p /home/rocketchat/.cache
root@hc4Noble:/home/alexlai# cd /opt/Rocket.Chat/programs/server/npm/node_modules/@rocket.chat/apps-engine
root@hc4Noble:/opt/Rocket.Chat/programs/server/npm/node_modules/@rocket.chat/apps-engine# export DENO_DIR=/home/rocketchat/.cache/deno
root@hc4Noble:/opt/Rocket.Chat/programs/server/npm/node_modules/@rocket.chat/apps-engine# npm install --production
npm warn config production Use `--omit=dev` instead.
npm warn deprecated hoek@6.1.3: This module has moved and is now available at @hapi/hoek. Please update your dependencies as this version is no longer maintained an may contain bugs and security issues.
npm warn deprecated cryptiles@4.1.3: This module has moved and is now available at @hapi/cryptiles. Please update your dependencies as this version is no longer maintained an may contain bugs and security issues.
npm warn deprecated boom@7.3.0: This module has moved and is now available at @hapi/boom. Please update your dependencies as this version is no longer maintained an may contain bugs and security issues.
> @rocket.chat/apps-engine@1.44.0 postinstall
> node scripts/postinstall.js
/opt/Rocket.Chat/programs/server/npm/node_modules/@rocket.chat/apps-engine/node_modules/deno-bin/bin/deno: 1: Syntax error: Unterminated quoted string
added 14 packages, and audited 18 packages in 2m
2 packages are looking for funding
run `npm fund` for details
4 high severity vulnerabilities
To address issues that do not require attention, run:
npm audit fix
Some issues need review, and may require choosing
a different dependency.
Run `npm audit` for details.
root@hc4Noble:/opt/Rocket.Chat/programs/server/npm/node_modules/@rocket.chat/apps-engine# npm run postinstall
> @rocket.chat/apps-engine@1.44.0 postinstall
> node scripts/postinstall.js
/opt/Rocket.Chat/programs/server/npm/node_modules/@rocket.chat/apps-engine/node_modules/deno-bin/bin/deno: 1: Syntax error: Unterminated quoted string
root@hc4Noble:/opt/Rocket.Chat/programs/server/npm/node_modules/@rocket.chat/apps-engine# chown -R rocketchat:rocketchat /opt/Rocket.Chat/
§2024-08-23
- n2Bookworm.yushei.com.tw
sudo apt install -y curl build-essential graphicsmagick
curl -L https://releases.rocket.chat/latest/download -o /tmp/rocket.chat.tgz
tar -xvzf /tmp/rocket.chat.tgz -C /tmp
cd /tmp/bundle/programs/server && npm install --production
...
npm notice New minor version of npm available! 10.7.0 -> 10.8.2
npm notice Changelog: https://github.com/npm/cli/releases/tag/v10.8.2
npm notice To update run: npm install -g npm@10.8.2
npm notice
npm error code 127
npm error path /tmp/bundle/programs/server/node_modules/fibers
npm error command failed
npm error command sh -c node build.js || nodejs build.js
npm error gyp info it worked if it ends with ok
npm error gyp info using node-gyp@8.0.0
npm error gyp info using node@22.2.0 | linux | arm64
npm error (node:23112) [DEP0060] DeprecationWarning: The `util._extend` API is deprecated. Please use Object.assign() instead.
npm error (Use `node --trace-deprecation ...` to show where the warning was created)
npm error gyp info find Python using Python version 3.11.2 found at "/usr/bin/python3"
npm error gyp http GET https://nodejs.org/download/release/v22.2.0/node-v22.2.0-headers.tar.gz
npm error gyp http 200 https://nodejs.org/download/release/v22.2.0/node-v22.2.0-headers.tar.gz
npm error gyp http GET https://nodejs.org/download/release/v22.2.0/SHASUMS256.txt
npm error gyp http 200 https://nodejs.org/download/release/v22.2.0/SHASUMS256.txt
npm error gyp ERR! UNCAUGHT EXCEPTION
npm error gyp ERR! stack TypeError: Cannot assign to read only property 'cflags' of object '#<Object>'
npm error gyp ERR! stack at createConfigFile (/tmp/bundle/programs/server/node_modules/node-gyp/lib/configure.js:117:21)
npm error gyp ERR! stack at /tmp/bundle/programs/server/node_modules/node-gyp/lib/configure.js:84:9
npm error gyp ERR! stack at FSReqCallback.oncomplete (node:fs:188:23)
npm error gyp ERR! System Linux 6.1.0-odroid-arm64
npm error gyp ERR! command "/home/alexlai/.local/share/fnm/node-versions/v22.2.0/installation/bin/node" "/tmp/bundle/programs/server/node_modules/.bin/node-gyp" "rebuild" "--release"
npm error gyp ERR! cwd /tmp/bundle/programs/server/node_modules/fibers
npm error gyp ERR! node -v v22.2.0
npm error gyp ERR! node-gyp -v v8.0.0
npm error gyp ERR! Node-gyp failed to build your package.
npm error gyp ERR! Try to update npm and/or node-gyp and if it does not help file an issue with the package author.
npm error node-gyp exited with code: 7
npm error Please make sure you are using a supported platform and node version. If you
npm error would like to compile fibers on this machine please make sure you have setup your
npm error build environment--
npm error Windows + OS X instructions here: https://github.com/nodejs/node-gyp
npm error Ubuntu users please run: `sudo apt-get install g++ build-essential`
npm error RHEL users please run: `yum install gcc-c++` and `yum groupinstall 'Development Tools'`
npm error Alpine users please run: `sudo apk add python make g++`
npm error sh: 1: nodejs: not found
npm error A complete log of this run can be found in: /home/alexlai/.npm/_logs/2024-08-22T23_41_46_722Z-debug-0.log