Unix & Linux Stack Exchange
Q&A for users of Linux, FreeBSD and other Unix-like operating systems
Latest Questions
3
votes
2
answers
2355
views
issues when installing nodejs for suse
I need to install `npm` in my suse distribution, so naturally I followed https://software.opensuse.org/download.html?project=devel%3Alanguages%3Anodejs&package=nodejs and https://nodejs.org/en/download/package-manager/#opensuse-and-sle but I got the same error and I didn't find out a way to fix it....
I need to install
npm
in my suse distribution, so naturally I followed https://software.opensuse.org/download.html?project=devel%3Alanguages%3Anodejs&package=nodejs and https://nodejs.org/en/download/package-manager/#opensuse-and-sle but I got the same error and I didn't find out a way to fix it.
**Details**
$ rpm -qf /etc/SuSE-release /etc/issue
sles-release-11.4-1.109
$ sudo zypper ar http://download.opensuse.org/repositories/devel:/languages:/nodejs/SLE_11_SP4/ Node.js
$ sudo zypper refresh
$ sudo zypper clean
$ sudo zypper update
$ sudo zypper install nodejs
> Loading repository data... Reading installed packages... Resolving
> package dependencies...
>
> Problem: nothing provides openssl1 needed by nodejs-6.9.1-130.1.x86_64
> Solution 1: do not install nodejs-6.9.1-130.1.x86_64 Solution 2:
> break nodejs-6.9.1-130.1.x86_64 by ignoring some of its dependencies
>
> Choose from above solutions by number or cancel [1/2/c] (c):
smarber
(1231 rep)
Dec 6, 2016, 03:32 PM
• Last activity: Aug 4, 2025, 05:10 PM
0
votes
2
answers
2480
views
Running http-server forever on ubuntu server
I have an ubuntu server. On which I have transferred some files which have some js and html code. I used http-server from node.js to start a web server so that I can display the html page on the server. I used nohup so that it can remain running even if I disconnect or close my system. Here is the c...
I have an ubuntu server. On which I have transferred some files which have some js and html code.
I used http-server from node.js to start a web server so that I can display the html page on the server.
I used nohup so that it can remain running even if I disconnect or close my system.
Here is the command I used:
nohup http-server -p 8000 -a 10.4.145.182 &
Now this allows me to visualize the files on 10.4.145.182:8000 but I am noticing after sometime the server goes down and one can't access the html page on that ip in their browser.
I thought nohup is for running things in background even if one closes their system or logs out of server.
So I asked around here and someone suggested using pm2. So got that installed.
As per the suggestion of using pm2, I installed latest version of node and then started service with pm2.
It says service started for http-server but when I go to ip with port 8000 on browser it doesn't open up.
Here is the command I ran in my directory which has the html and d3 files.
$ pm2 start $(which http-server) -p 8000
And here is the output in shell of the pm2
How to run the server forever without getting halted and what's going wrong with pm2?

Baktaawar
(101 rep)
Feb 25, 2019, 06:57 PM
• Last activity: Jul 8, 2025, 05:06 AM
0
votes
1
answers
1934
views
Unpack Node.js to a custom folder and perform paths setup
I want to unpack [Node.js (Linux Binaries (x64))][1] to a custom folder and use it for a few projects. The difficulties appear when I start using console. I can't use `npm` at all and I've got no idea how to install global modules in this case. For instance, I install `gulp -g` and even specify the...
I want to unpack Node.js (Linux Binaries (x64)) to a custom folder and use it for a few projects.
The difficulties appear when I start using console. I can't use
npm
at all and I've got no idea how to install global modules in this case.
For instance, I install gulp -g
and even specify the installation path for it, but when I wish to use gulp
, it doesn't work.
So, again, I do not use package managers and /usr/lib
folders, the whole node.js package in one, single folder. How to use it that way if possible at all?
There may be a few more Node.js versions there and it would be greate to have a way of setting up the /paths/variables
for the selected /folder/version
of Node.js.
CodeGust
(141 rep)
Mar 6, 2020, 01:00 PM
• Last activity: Jun 22, 2025, 01:08 AM
3
votes
1
answers
1910
views
Problem with gpg when using apt
I'm scratching my head to find a way to correct broken gpg stuff in `apt`. When i try to install Nodejs : curl -sL https://deb.nodesource.com/setup_7.x | sudo -E bash - sudo apt-get install -y nodejs I get this error : ## You seem to be using Debian version stretch. ## This maps to Debian "jessie".....
I'm scratching my head to find a way to correct broken gpg stuff in
apt
.
When i try to install Nodejs :
curl -sL https://deb.nodesource.com/setup_7.x | sudo -E bash -
sudo apt-get install -y nodejs
I get this error :
## You seem to be using Debian version stretch.
## This maps to Debian "jessie"... Adjusting for you...
## Confirming "jessie" is supported...
+ curl -sLf -o /dev/null 'https://deb.nodesource.com/node_7.x/dists/jessie/Release '
## Adding the NodeSource signing key to your keyring...
+ curl -s https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add -
gpg: [don't know]: invalid packet (ctb=00)
gpg: keydb_get_keyblock failed: Valeur non trouvée
gpg: [don't know]: invalid packet (ctb=00)
gpg: /tmp/apt-key-gpghome.ix2LFsfXOw/pubring.gpg: copy to '/tmp/apt-key-gpghome.ix2LFsfXOw/pubring.gpg.tmp' failed: Paquet incorrect
gpg: error writing keyring '/tmp/apt-key-gpghome.ix2LFsfXOw/pubring.gpg': Paquet incorrect
gpg: [don't know]: invalid packet (ctb=00)
gpg: error reading '-': Paquet incorrect
gpg: import from '-' failed: Paquet incorrect
Error executing command, exiting
I use a Debian stretch rc2 with kernel 10.5. Don't know if it's the problem or not. I can't use stable version of debian because i'm running on a Ryzen processor.
When i try to install VSCode, i got another error too:
W: Erreur de GPG : http://packages.microsoft.com/repos/vscode stable InRelease : Les signatures suivantes n'ont pas pu être vérifiées car la clé publique n'est pas disponible : NO_PUBKEY EB3E94ADBE1229CF
W: The repository 'http://packages.microsoft.com/repos/vscode stable InRelease' is not signed.
N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
N: See apt-secure(8) manpage for repository creation and user configuration details.
Any idea?
[EDIT]
This is my source.list
deb http://ftp.univ-pau.fr/linux/mirrors/debian/ stretch main non-free contrib
deb-src http://ftp.univ-pau.fr/linux/mirrors/debian/ stretch main non-free contrib
deb http://security.debian.org/debian-security/ stretch/updates main contrib non-free
deb-src http://security.debian.org/debian-security/ stretch/updates main contrib non-free
# stretch-updates, previously known as 'volatile'
deb http://ftp.univ-pau.fr/linux/mirrors/debian/ stretch-updates main contrib non-free
deb-src http://ftp.univ-pau.fr/linux/mirrors/debian/ stretch-updates main contrib non-free
# stretch-backports, previously on backports.debian.org
deb http://ftp.univ-pau.fr/linux/mirrors/debian/ stretch-backports main contrib non-free
deb-src http://ftp.univ-pau.fr/linux/mirrors/debian/ stretch-backports main contrib non-free
# deb [arch=amd64] https://download.docker.com/linux/debian/ stretch stable
# deb-src [arch=amd64] https://download.docker.com/linux/debian/ stretch stable
deb http://www.deb-multimedia.org/ stretch main non-free
deb [arch=amd64] http://packages.microsoft.com/repos/vscode stable main
Scandinave
(131 rep)
Apr 8, 2017, 09:14 AM
• Last activity: May 18, 2025, 06:04 PM
2
votes
1
answers
2141
views
PM2 inside bash script deployed by puppet not working
#!/bin/bash # install needed RPMS yum -y install gcc-c++ git # downlaod and compile node wget https://nodejs.org/dist/v0.12.7/node-v0.12.7.tar.gz tar -xvzf node-v0.12.7.tar.gz cd node-v0.12.7 ./configure make sudo make install # install pm2 via npm /usr/local/bin/npm install pm2 -g # start processes...
#!/bin/bash
# install needed RPMS
yum -y install gcc-c++ git
# downlaod and compile node
wget https://nodejs.org/dist/v0.12.7/node-v0.12.7.tar.gz
tar -xvzf node-v0.12.7.tar.gz
cd node-v0.12.7
./configure
make
sudo make install
# install pm2 via npm
/usr/local/bin/npm install pm2 -g
# start processes.json
cd /home/admin/Order-Management/
/usr/local/lib/node_modules/pm2/bin/pm2 start processes.json
The above script run perfectly when I run it locally but when I try to execute it with puppet on the client machine the last line throwing the following error.
/usr/bin/env: node: No such file or directory
I am using RedHat 6 master and RedHat 6 client. I saw a solution here
https://stackoverflow.com/questions/30281057/node-forever-usr-bin-env-node-no-such-file-or-director However it's not working for me.
user2178244
(21 rep)
Sep 8, 2015, 02:43 PM
• Last activity: May 3, 2025, 06:04 PM
1
votes
1
answers
5610
views
Installing node 14 on centos 7, how does it work?
The code for installing node 14 on centos7 is: RUN curl -sL https://rpm.nodesource.com/setup_14.x | bash - RUN yum -y install nodejs How does it work? The first command downloads the package. Where does it get stored? How does the second command install nodejs from the downloaded package? Thanks. Wh...
The code for installing node 14 on centos7 is:
RUN curl -sL https://rpm.nodesource.com/setup_14.x | bash -
RUN yum -y install nodejs
How does it work? The first command downloads the package. Where does it get stored? How does the second command install nodejs from the downloaded package? Thanks.
What is the difference between putting
bash
and bash -
**UPDATE:**
If someone came to this question searching for installing node in centos7, here is a code snippet that gets the exact version from NodeJS website.
RUN wget https://nodejs.org/download/release/v14.17.0/node-v14.17.0-linux-x64.tar.gz && \
tar xf node-v14.17.0-linux-x64.tar.gz -C /opt/ && \
rm node-v14.17.0-linux-x64.tar.gz
ENV PATH=/opt/node-v14.17.0-linux-x64/bin:$PATH
RUN npm config set cache /tmp --global
vijayst
(111 rep)
Apr 21, 2022, 05:07 PM
• Last activity: Apr 22, 2025, 05:02 PM
1
votes
1
answers
7421
views
NVM cannot find installed Node binary, PATH problem on Linux Mint 17?
I've successfully installed NVM and Node using official instructions. My `.bashrc` file contains [ -s "/home/user/.nvm/nvm.sh" ] && . "/home/user/.nvm/nvm.sh" After some time, maybe a day, I noticed that Node is not present anymore . So I tried: $ nvm use 0.10 N/A version is not installed yet That's...
I've successfully installed NVM and Node using official instructions. My
.bashrc
file contains
[ -s "/home/user/.nvm/nvm.sh" ] && . "/home/user/.nvm/nvm.sh"
After some time, maybe a day, I noticed that Node is not present anymore . So I tried:
$ nvm use 0.10
N/A version is not installed yet
That's weird, I know that I installed it with nvm install 0.10
, used it to run a script, and found it here:
$ ls .nvm/v0.10.29/
bin ChangeLog include lib LICENSE README.md share
So, everything looks right, but NVM simply doesn't work:
$ nvm install 0.10
mkdir: cannot create directory ‘/etc/mdm/bin’: Permission denied
Binary download failed, trying source.
Additional options while compiling:
mkdir: cannot create directory ‘/etc/mdm/src’: Permission denied
nvm: install v0.10.29 failed!
$ nvm deactivate
Could not find /etc/mdm/*/bin in $PATH
Could not find /etc/mdm/*/share/man in $MANPATH
Could not find /etc/mdm/*/lib/node_modules in $NODE_PATH
Output shows that nvm is trying to use /etc/mdm/* dir, and this doesn't make any sense. MDM is display manager in Linux Mint. Any ideas ?
UPDATE:
just checked now, seems that $NVM_DIR is set to /etc/mdm. That's probably why everything fails, but don't know when this get set, or why.
UPDATE 2(FIX):
export NVM_DIR=/home/user/.nvm
will fix this problem.
Zed
(111 rep)
Jun 17, 2014, 01:50 PM
• Last activity: Apr 16, 2025, 06:01 PM
0
votes
0
answers
162
views
Process substitution doesn't work with diff and node
I'm trying to compare the output of my `fizzbuzz.js` program: for (let i = 1; i <= 100; i++) { let out = ""; if (i % 3 == 0) out += "Fizz"; if (i % 5 == 0) out += "Buzz"; if (i % 3 && i % 5) out = i; console.log(out); } with the contents of a `expected-output.txt` file which contains: 1 2 Fizz 4 Buz...
I'm trying to compare the output of my
fizzbuzz.js
program:
for (let i = 1; i <= 100; i++) {
let out = "";
if (i % 3 == 0) out += "Fizz";
if (i % 5 == 0) out += "Buzz";
if (i % 3 && i % 5) out = i;
console.log(out);
}
with the contents of a expected-output.txt
file which contains:
1
2
Fizz
4
Buzz
Fizz
7
8
Fizz
Buzz
11
Fizz
13
14
[...]
I can't get process substitution to work:
diff -u expected-output.txt <(node fizzbuzz.js)
seems to hang indefinitely. What could be causing this?
My environment is macOS Mojave, bash 3.2.57, node v12.5.0.
EDIT: this seems to be a macOS issue. Everything works fine on a Ubuntu 18.04 machine with newer bash 4.4.19
Chef Tony
(465 rep)
Jul 14, 2019, 06:09 PM
• Last activity: Apr 12, 2025, 12:59 PM
11
votes
4
answers
42161
views
systemd - My custom service exits with status code 216/GROUP
I installed the following unit file for an Nodejs Express Server: [Unit] Description=Server for SpeedBot After=network.target [Service] ExecStart=/var/www/SpeedBot/server.js Restart=always User=nobody Group=nobody Environment=PATH=/usr/bin:/usr/local/bin Environment=NODE_ENV=production WorkingDirect...
I installed the following unit file for an Nodejs Express Server:
[Unit]
Description=Server for SpeedBot
After=network.target
[Service]
ExecStart=/var/www/SpeedBot/server.js
Restart=always
User=nobody
Group=nobody
Environment=PATH=/usr/bin:/usr/local/bin
Environment=NODE_ENV=production
WorkingDirectory=/home/pi/SpeedBot/server.js
[Install]
WantedBy=multi-user.target
When I run it and do:
service speedbotserver status
i get:
● speedbotserver.service - Server for SpeedBot
Loaded: loaded (/etc/systemd/system/speedbotserver.service; disabled)
Active: failed (Result: start-limit) since Thu 2017-06-29 01:31:18 UTC; 18h ago
Process: 19189 ExecStart=/var/www/SpeedBot/server.js (code=exited, status=216/GROUP)
Main PID: 19189 (code=exited, status=216/GROUP)
medicengonzo
(231 rep)
Jun 29, 2017, 07:52 PM
• Last activity: Apr 10, 2025, 01:12 PM
0
votes
0
answers
39
views
FFmpeg not detecting input streams for RTMP live recording
getting this type of error Opening an output file: rtmp://localhost:1935/live/stream. FFmpeg stderr: [out#0/flv @ 0x600003b843c0] No explicit maps, mapping streams automatically... FFmpeg stderr: Output #0, flv, to 'rtmp://localhost:1935/live/stream': [out#0/flv @ 0x600003b843c0] Output file does no...
getting this type of error
Opening an output file: rtmp://localhost:1935/live/stream.
FFmpeg stderr: [out#0/flv @ 0x600003b843c0] No explicit maps, mapping streams automatically...
FFmpeg stderr: Output #0, flv, to 'rtmp://localhost:1935/live/stream':
[out#0/flv @ 0x600003b843c0] Output file does not contain any stream
FFmpeg stderr: Error opening output file rtmp://localhost:1935/live/stream.
Error opening output files: Invalid argument
FFmpeg process closed with code 234
import { spawn, ChildProcessWithoutNullStreams } from "child_process";
import fs from "fs";
import path from "path";
import ffmpeg from 'fluent-ffmpeg';
class RecordingService {
private ffmpegProcess: any = null; //ffmpeg.FfmpegCommand | null = null;
private readonly recordingsDir: string = "recordings";
private outputFile: string = "";
private readonly streamUrl: string = "rtmp://localhost:1935/live/stream";
private readonly hlsOutputDir: string = "/usr/local/nginx/html/hls";
constructor() {
if (!fs.existsSync(this.recordingsDir)) {
fs.mkdirSync(this.recordingsDir, { recursive: true });
}
}
async startRecording(data: any, socket: any): Promise {
console.log("Starting FFmpeg recording...", JSON.stringify(data, null, 2));
this.outputFile = path.join(this.recordingsDir, recording_${Date.now()}.mp4
);
const hlsOutput = path.join(this.hlsOutputDir, "live.m3u8");
console.log("🚀 ~ RecordingService ~ startRecording ~ hlsOutput:", hlsOutput);
const audioTrack = data?.stream?._tracks.find((track: any) => track.kind === "audio");
const videoTrack = data?.stream?._tracks.find((track: any) => track.kind === "video");
if (!audioTrack || !videoTrack) {
console.error("Audio or video track missing.");
return;
}
const audioDevice = audioTrack._settings.deviceId;
const videoDevice = videoTrack._settings.deviceId;
console.log("🚀 ~ RecordingService ~ startRecording ~ audioDevice:", audioDevice);
console.log("🚀 ~ RecordingService ~ startRecording ~ videoDevice:", videoDevice);
const ffmpegArgs = [
'-loglevel', 'debug',
// '-f', pipe: 0, // Use 'avfoundation' for macOS
'-f', 'flv', this.streamUrl,
"-an",
// '-i', ${videoDevice}:${audioDevice}
, // Combined video and audio input (using device IDs)
'-pix_fmt', 'uyvy422',
'-acodec', 'aac',
'-vcodec', 'libx264',
'-b:v', '1000k',
'-preset', 'ultrafast',
'-tune', 'zerolatency',
'-f', 'mp4',
this.outputFile
];
this.ffmpegProcess = spawn('ffmpeg', ffmpegArgs);
console.log(Recording started. Saving to: ${this.outputFile}
);
// Handle FFmpeg process events
this.ffmpegProcess.stdout.on('data', (data: Buffer) => {
console.log('FFmpeg stdout:', data.toString());
});
this.ffmpegProcess.stderr.on('data', (data: Buffer) => {
console.error('FFmpeg stderr:', data.toString());
});
this.ffmpegProcess.on('close', (code: number) => {
console.log(FFmpeg process closed with code ${code}
);
});
socket.on('data', (streamData: Buffer) => {
if (this.ffmpegProcess) {
console.log(" Write the stream data to ffmpeg's stdin......");
this.ffmpegProcess.stdin.write(streamData); // Write the stream data to ffmpeg's stdin
} else {
console.error('FFmpeg process is not available.');
}
});
socket.on('end', () => {
if (this.ffmpegProcess) {
this.ffmpegProcess.stdin.end(); // Properly close the input stream
}
});
console.log(Recording started. Saving to: ${this.outputFile}
);
}
async stopRecording(): Promise {
console.log("Stopping recording...");
if (this.ffmpegProcess) {
console.log(1111111111)
// If FFmpeg process is running, stop it
this.ffmpegProcess.kill('SIGINT');
console.log(22222222)
await new Promise((resolve) => setTimeout(resolve, 2000));
if (fs.existsSync(this.outputFile)) {
console.log(3333333)
console.log(Recording saved: ${this.outputFile}
);
} else {
console.warn("Recording file not found after stopping!");
}
this.ffmpegProcess = null;
}
}
getLatestRecording(): string | null {
const files = fs.readdirSync(this.recordingsDir)
.filter(file => file.endsWith(".mp4"))
.sort((a, b) => fs.statSync(path.join(this.recordingsDir, b)).mtimeMs - fs.statSync(path.join(this.recordingsDir, a)).mtimeMs);
return files.length > 0 ? path.join(this.recordingsDir, files) : null;
}
}
export default RecordingService;
gayatri Sutariya
(1 rep)
Apr 1, 2025, 09:19 AM
• Last activity: Apr 1, 2025, 09:33 AM
1
votes
1
answers
75
views
How can I specify which Node version to use when Node was installed with Homebrew?
I used [Homebrew](https://formulae.brew.sh/formula/node) to install Node on Ubuntu 16.04.4 LTS: ``` brew install node ``` I'd like to use NodeJS version 18.8.0 or higher up to system default -> node (-> v18.18.2) iojs -> N/A (default) unstable -> N/A (default) node -> stable (-> v18.18.2) (default)...
I used [Homebrew](https://formulae.brew.sh/formula/node) to install Node on Ubuntu 16.04.4 LTS:
brew install node
I'd like to use NodeJS version 18.8.0 or higher up to system
default -> node (-> v18.18.2)
iojs -> N/A (default)
unstable -> N/A (default)
node -> stable (-> v18.18.2) (default)
stable -> 18.18 (-> v18.18.2) (default)
lts/* -> lts/jod (-> N/A)
lts/argon -> v4.9.1 (-> N/A)
lts/boron -> v6.17.1 (-> N/A)
lts/carbon -> v8.17.0 (-> N/A)
lts/dubnium -> v10.24.1 (-> N/A)
lts/erbium -> v12.22.12 (-> N/A)
lts/fermium -> v14.21.3 (-> N/A)
lts/gallium -> v16.20.2
lts/hydrogen -> v18.20.7 (-> N/A)
lts/iron -> v20.18.3 (-> N/A)
lts/jod -> v22.14.0 (-> N/A)
```
Franck Dernoncourt
(5533 rep)
Feb 21, 2025, 05:51 AM
• Last activity: Feb 21, 2025, 10:45 AM
-1
votes
1
answers
39
views
How can I install Node version 5.6.0 or higher on Ubuntu 16.04.4 LTS?
The computer is running Ubuntu 16.04.4 LTS 64-bit. Running `nvm use 16.20.2` works fine and gives me nodejs 4.2.6 (checked with `nodejs --version`). I'd like to use Node version 5.6.0 or higher on it, so I tried running: ``` user@server:~/test$ nvm use 18.18.2 ``` But I get the error: ``` node: /lib...
The computer is running Ubuntu 16.04.4 LTS 64-bit. Running
nvm use 16.20.2
works fine and gives me nodejs 4.2.6 (checked with nodejs --version
). I'd like to use Node version 5.6.0 or higher on it, so I tried running:
user@server:~/test$ nvm use 18.18.2
But I get the error:
node: /lib/x86_64-linux-gnu/libm.so.6: version `GLIBC_2.27' not found (required by node)
node: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.25' not found (required by node)
node: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.28' not found (required by node)
The error occurs because the Node.js version 18.18.2 requires a more recent glibc version (2.25, 2.27, or 2.28) that is not installed.
How can I install Node version 5.6.0 of higher on Ubuntu 16.04?
Franck Dernoncourt
(5533 rep)
Feb 20, 2025, 09:18 AM
• Last activity: Feb 21, 2025, 05:36 AM
1
votes
2
answers
2088
views
Installing npm on Centos 7
I can say I went through **all Google results regarding this**, but no one works. The GNU libc version is very old: `ldd (GNU libc) 2.17`. Trying version up to `nodesource 8.x` **all installations fails because of the old GNU libc**: Error: Package: 2:nodejs-19.9.0-1nodesource.x86_64 (nodesource) Re...
I can say I went through **all Google results regarding this**, but no one works. The GNU libc version is very old:
ldd (GNU libc) 2.17
.
Trying version up to nodesource 8.x
**all installations fails because of the old GNU libc**:
Error: Package: 2:nodejs-19.9.0-1nodesource.x86_64 (nodesource)
Requires: libm.so.6(GLIBC_2.27)(64bit)
Error: Package: 2:nodejs-19.9.0-1nodesource.x86_64 (nodesource)
Requires: libc.so.6(GLIBC_2.28)(64bit)
What can I do? Would it help when I try to build node from the source with gcc-c++
? Reading the requirements I doubt this will work because Centos 7 has also a very old gcc version which is not supported anymore, or am I wrong?
Any hints?
Peter VARGA
(1082 rep)
Jun 13, 2023, 07:32 PM
• Last activity: Jan 6, 2025, 12:51 PM
1
votes
2
answers
1357
views
How to run node v20.x on CentOs 7.9?
I've been stuck on this issue for too long. Basically I have a node v20.x app that I'd like to run on a CentOS 7.9 server. For reasons, we do not wish to upgrade the OS now but I'm sure there must be a way to run node v20? I've built and installed GCC 10.3 from source, which I've read was required f...
I've been stuck on this issue for too long. Basically I have a node v20.x app that I'd like to run on a CentOS 7.9 server. For reasons, we do not wish to upgrade the OS now but I'm sure there must be a way to run node v20?
I've built and installed GCC 10.3 from source, which I've read was required for node 20 but still getting errors.
These are the errors I currently have on running
node .
node .
node: /lib64/libm.so.6: version `GLIBC_2.27' not found (required by node)
node: /lib64/libc.so.6: version `GLIBC_2.28' not found (required by node)
node: /lib64/libc.so.6: version `GLIBC_2.25' not found (required by node)
`node: /lib64/libstdc++.so.6: version GLIBCXX_3.4.20 not found (required by node)
node: /lib64/libstdc++.so.6: version CXXABI_1.3.9 not found (required by node)
node: /lib64/libstdc++.so.6: version GLIBCXX_3.4.21 not found (required by node)`
Would this be possible? And how do I proceed?
Also, I'm a bit careful not to interupt the apache / mysql server running in the mean time.
I've read that upgrading glibc on CentOS 7 can be extremely dangerous making the system unbootable?
Is there really no safe way around this?
Z0q
(631 rep)
Nov 22, 2024, 04:00 PM
• Last activity: Jan 6, 2025, 12:51 PM
-1
votes
1
answers
74
views
Mysql is closing the connection on Ubuntu
I built a MERN app (used mysql instead of MongoDB) * I deployed it on the VPS (Ubuntu 24.04) * everything seems okay but when I try to check the logs of my backend using `pm2` package it gives me kind of weird picture: first it gives me errors and then seems it is connected. * This is my db connecti...
I built a MERN app (used mysql instead of MongoDB)
* I deployed it on the VPS (Ubuntu 24.04)
* everything seems okay but when I try to check the logs of my backend using
pm2
package it gives me kind of weird picture: first it gives me errors and then seems it is connected.
* This is my db connection code
const mysql = require('mysql2');
const dbHost = "127.0.0.1";
const databaseConnection = () => {
const db = mysql.createConnection({
host: '127.0.0.1',
user: 'Test',
password: 'Iwillnottell',
database: 'Test',
});
db.connect(err => {
if (err) throw err;
console.log('MySQL Connected...');
});
return db; };
module.exports = databaseConnection();

Shayan Kanwal
(99 rep)
Dec 9, 2024, 11:05 AM
• Last activity: Dec 9, 2024, 01:17 PM
1
votes
1
answers
765
views
Make npm work in tails
The latest tails comes with nodejs v10.24.0. Trying to get tails to run a newer node has been unsuccessful even after running script from deb.nodesource.com/setup_14x which said buster was unsupported. I think updating node was a red herring anyway. npm is not included so I use ```sudo apt install n...
The latest tails comes with nodejs v10.24.0. Trying to get tails to run a newer node has been unsuccessful even after running script from deb.nodesource.com/setup_14x which said buster was unsupported. I think updating node was a red herring anyway.
npm is not included so I use
apt install npm
to install npm. I get version 5.8.0. I need npm to install create-react-app and other node tools.
All npm commands return warning
Npm does not support node.js v10.24.0
(hence the red herring to update that)
In persistant storage I create a directory "foo" and cd to foo, I run
init
And then
install
And in addition to the warning above it seems to fail to connect to
registry.npmjs.org:443
with getaddrinfo EAI_AGAIN
Putting that url into the tor browser connects just fine.
My current working theory is that I need to configure npm proxy and npm https-proxy, but for that I seem to require proxy credentials, url, and port. I don't know what those are or how to find them in tails. I am not behind any other proxy besides tor running in Tails.
Question: how to make npm work in tails.
DavesPlanet
(121 rep)
Dec 6, 2021, 03:24 AM
• Last activity: Nov 30, 2024, 09:48 PM
0
votes
0
answers
326
views
PAM Login Service Authentication Failure for other users (Debian Bookworm)
I have an node-express api application that's running as a service where I implemented a PAM authentication using `authenticate-pam` and `node-linux-pam'` library. Whenever I call the /login endpoint it fails for other users but not this {ok-user}. I tried calling the endpoint using a react app (mai...
I have an node-express api application that's running as a service where I implemented a PAM authentication using
authenticate-pam
and node-linux-pam'
library. Whenever I call the /login endpoint it fails for other users but not this {ok-user}. I tried calling the endpoint using a react app (main & simple), postman and curl - fails for other user and success for {ok-user}.
This {ok-user} is what I'm using to the run the services. The issue is that the pam authentication for other users fails except {ok-user}. I already checked and the other users are authenticated or present using pamtester, grep the users in /etc/shadow & /etc/passwd, and login in the terminal via ssh.
I did not add any special configuration for {ok-user} and I also re-installed pam.d to reset the configurations but the issue still persist.
**The main issue is that it can find the user but can't authenticate the password via the API PAM authentication.**
This is the only log details I can get when the auth fails. I tried a lot of ways to get more details but nothing worked.
2024-11-20T11:36:22.218288+11:00 {ok-user} node: pam_unix(login:auth): username [testuser] obtained
2024-11-20T11:36:22.288307+11:00 {ok-user} unix_chkpwd: check pass; user unknown
2024-11-20T11:36:22.349069+11:00 {ok-user} unix_chkpwd: check pass; user unknown
2024-11-20T11:36:22.350108+11:00 {ok-user} unix_chkpwd: password check failed for user (testuser)
2024-11-20T11:36:22.351009+11:00 {ok-user} node: pam_unix(login:auth): authentication failure; logname= uid=1001 euid=1001 tty= ruser= rhost= user=testuser
When the auth succeeds this is what I get only.
2024-11-20T11:37:44.293536+11:00 {ok-user} node: pam_unix(login:auth): username [{ok-user}] obtained
Also, when the common-auth is configured like this it fails for all users, but it does not log an authentication failure message for {ok-user}, only for others.
auth required pam_unix.so nullok_secure debug
...
If the configuration is like this it does not fail for {ok-user}.
auth [success=1 default=ignore] pam_unix.so nullok debug
...
Below is my pam authentication logic in the api. This uses PAM login service automatically.
/ PAM Authentication function
function authenticateWithPAM(username, password, callback) {
pam.authenticate(username, password, (err) => {
if (err) {
return callback(false); // Authentication failed
}
callback(true); // Authentication successful
});
}
Thank you in advance for your help.
zerotwo
(1 rep)
Nov 20, 2024, 01:54 AM
• Last activity: Nov 20, 2024, 05:30 AM
14
votes
6
answers
122377
views
How to fix exit status 127?
I attempted to follow [this guide](https://certsimple.com/blog/deploy-node-on-linux#node-linux-service-systemd) to run a Node application as a service. However, it is failing to start, with exit code 127. Is there any way to fix this? This is the journal. sudo journalctl --follow -u serviceName -- L...
I attempted to follow [this guide](https://certsimple.com/blog/deploy-node-on-linux#node-linux-service-systemd) to run a Node application as a service. However, it is failing to start, with exit code 127. Is there any way to fix this?
This is the journal.
sudo journalctl --follow -u serviceName
-- Logs begin at Tue 2017-08-08 16:27:10 GMT. --
Aug 08 17:06:57 raspberrypi systemd: Started serviceName.
Aug 08 17:06:57 raspberrypi app.js: [46B blob data]
Aug 08 17:06:57 raspberrypi systemd: serviceName.service: main process exited, code=exited, status=127/n/a
Aug 08 17:06:57 raspberrypi systemd: Unit serviceName.service entered failed state.
Aug 08 17:06:57 raspberrypi systemd: serviceName.service holdoff time over, scheduling restart.
Aug 08 17:06:57 raspberrypi systemd: Stopping serviceName...
Aug 08 17:06:57 raspberrypi systemd: Starting serviceName...
Aug 08 17:06:57 raspberrypi systemd: serviceName.service start request repeated too quickly, refusing to start.
Aug 08 17:06:57 raspberrypi systemd: Failed to start serviceName.
Aug 08 17:06:57 raspberrypi systemd: Unit serviceName.service entered failed state.
This is the serviceName.service.
[Unit]
Description=ServiceName
After=network.target
[Service]
ExecStart=/home/pi/projects/ServiceName/app.js
Restart=always
User=root
Group=root
Environment=PATH=/usr/bin:/usr/local/bin
Environment=NODE_ENV=production
WorkingDirectory=/home/pi/projects/ServiceName
[Install]
WantedBy=multi-user.target
This is at the top of my app.js.
#!/usr/bin/env node
Chris Talman
(241 rep)
Aug 8, 2017, 05:35 PM
• Last activity: Nov 14, 2024, 11:32 PM
0
votes
2
answers
1689
views
Bash replace multiple lines in a file between two patterns with the content of another file?
I have a long javascript file ``long.js`` which has this content as a part of it ``` ... more lines ProcessCoverageController.createExampleQueries = function () { return [ { title: '-- Select a query --', query: '' }, { title: 'No encoding', query: 'return avg($c)' } ]; }; ProcessCoverageController....
I have a long javascript file `
long.js
` which has this content as a part of it
... more lines
ProcessCoverageController.createExampleQueries = function () {
return [
{
title: '-- Select a query --',
query: ''
}, {
title: 'No encoding',
query: 'return avg($c)'
}
];
};
ProcessCoverageController.$inject = [
"$scope",
"$log",
"$interval",
"Notification",
"rasdaman.WCSService",
"rasdaman.ErrorHandlingService"
];
... more lines
What I want to do is to replace the content of return [ ... ];
with the content from another file (e.g: `content.js
`) which has this content:
return [
{
title: 'title1',
query: query1 as asdasd asdasd
}, {
title: 'title2',
query: query2 asdas dasd asd asda
}, {
title: 'title3',
query: query3 asd asdasdasdasdasdasdasd
}, {
title: 'title4',
query: query4 3asd asdasda sdasdasdasdasdad
}
];
Can someone give me a hint how to do that with sed or perl (I've tried to look at that, and it seems perl is an easier tool to do then sed). This example below doesn't work properly though:
#!/bin/bash
file_content=cat content.js
perl -i -p0e 's/ProcessCoverageController.createExampleQueries = function.*?ProcessCoverageController.\$inject/$file_content/s' long.js
Bằng Rikimaru
(195 rep)
Jan 12, 2021, 03:20 PM
• Last activity: Oct 22, 2024, 06:53 AM
78
votes
6
answers
51837
views
nvm command not available in bash script
I am trying to build a script in in which `nvm` and eventually node will get installed. I have installed `nvm` with cURL. I see the modifications in the `.profile` or `.bashrc` file (both work) and when typing the `nvm` at the bash prompt, it shows the options available etc. So nvm works. Manually I...
I am trying to build a script in in which
nvm
and eventually node will get installed.
I have installed nvm
with cURL. I see the modifications in the .profile
or .bashrc
file (both work) and when typing the nvm
at the bash prompt, it shows the options available etc.
So nvm works. Manually I can install node, but as soon as I put the nvm
command in a shell script:
nano test.sh
#!/bin/bash
nvm
and run it with:
chmod 755 test.sh
./test.sh
I get:
./test.sh: line 2: nvm: command not found
If it can't find nvm
, I don't even have to think of
nvm ls-remote
or
nvm install ...
I got Ubuntu 14.04 installed and Bash is my shell.
okidoki
(783 rep)
Feb 12, 2015, 05:12 PM
• Last activity: Aug 14, 2024, 06:33 AM
Showing page 1 of 20 total questions