Questions tagged [node.js]
Node.js is an event based, asynchronous I/O framework that uses Google's V8 JavaScript engine.
262 questions
2
votes
0
answers
49
views
What am I doing wrong here? (npm, root privileges ... ?)
Somewhat floundering. I'm trying to install and run an open-source app called "Swordfish", which is a CAT (computer-assisted translation) app.
I've never really built from source before in ...
0
votes
0
answers
73
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: ...
1
vote
1
answer
106
views
How can I specify which Node version to use when Node was installed with Homebrew?
I used Homebrew 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 <20.0.0.
I therefore ran:
nvm install 18.18.2
However, I can't seem ...
-1
votes
1
answer
55
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 ...
-1
votes
1
answer
96
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 ...
1
vote
3
answers
2k
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 ...
0
votes
0
answers
144
views
Node.js recently started emitting all stderr in red text. How to handle this cleanly?
I use ANSI colorized text output in logs and other output that I emit on stderr in some of my programs. Since I've been doing this kind of thing for years, I am pretty familiar with the capabilities.
...
0
votes
1
answer
118
views
Mismatched versions warning when updating Node.js/NPM in Docker
In our Dockerfile we have:
FROM ghcr.io/puppeteer/puppeteer:latest AS pdf
WORKDIR /puppeteer
USER root
# Prerequisites
RUN apt-get update && apt-get install nginx -y
# Update
RUN npm update
...
1
vote
1
answer
533
views
How to encrypt a file with openssl like it’s done by node?
I’m trying to convert a NodeJS script that I’m using to encrypt JSON files to the openssl format, but I can’t find a way to get the exact same result.
Here is the NodeJS script:
const process = ...
1
vote
0
answers
226
views
File access permissions: Running app under PM2 gives EACCES denied for a file my app needs
I have an Ubuntu 22.04 environment.
I have a NodeJS app that is running a webserver and needs access to the certificates to enable HTTPS.
When I run the app under pm2 (user: brad), I receive a EACCES: ...
0
votes
1
answer
285
views
How can I start a NPM app from a desktop shortcut?
I have created a desktop shortcut for a npm application called TMXEditor, but it doesn't work.
I can launch the app if I do cd /home/souto/Apps/maxprograms/TMXEditor && npm start on a terminal....
0
votes
1
answer
261
views
Not able to install nodejs 21 in ubuntu wsl
When I try to install nodejs 21 in Ubuntu wsl I get the following error
curl -fsSL https://deb.nodesource.com/setup_21.x | sudo -E bash - &&sudo apt-get install -y nodejs
Error
The following ...
0
votes
0
answers
43
views
I think nodejs broke Linux Mint after it was about 50% done with updating: E: Sub-process /usr/bin/dpkg returned an error code (1)
So there's a lot here probably best explained by copy-pasting what happened on the terminal but the problem is I currently cannot open any windows that are already minimized, except Discord since it ...
0
votes
1
answer
61
views
Stay on a port listening to understand why it closes with which error
I should listen (I don't know) on a certain port, in this case the 8080, to understand why it closes and if so with what error.
I have a nodejs server running on the 8080, but I can't figure out why ...
0
votes
1
answer
764
views
Undoing effect of adding a Ubuntu-intended repository and updating on Debian
tl;dr
How do I fix this error on Debian
E: The repository 'https://deb.nodesource.com/node_current.x nodistro Release' does not have a Release file.
N: Updating from such a repository can't be done ...
0
votes
1
answer
833
views
How can I write a function that returns the results of a one-line `node` script?
I'm trying to write a very simple bash function that uses a one-line node script to read the value of a key from a JSON file. Here's the current contents of utils.bash:
#!/bin/bash
project_name() {
...
0
votes
1
answer
761
views
Why the docker-compose.yml environment overrides the .env file content?
I have a docker container that is set up using docker-compose.yml and I introduce a couple of environment variables in it:
environment:
- AUTH_SECRET=some_secret
Then I have these ...
1
vote
1
answer
649
views
Openssl output to socket
I want to extract the signer from an S/MIME file inside a node app. I use (child_process.spawn(), which runs this command
openssl smime -verify -CAfile c_root.pem -inform DER -signer /proc/self/fd/1
...
0
votes
0
answers
246
views
Why is node running and how was it started?
On Debian11/KDE I see that node is running and accessing the Internet but I didn't start it.
How can I find out how it got started to see why it's running and prevent that? ps -p {pid} -lf doesn't ...
1
vote
2
answers
2k
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 ...
1
vote
1
answer
312
views
OpenBSD: npm install sodium-native, interpret error messages
I am attempting to install sodium native as an npm package on OpenBSD 7.3 amd64.
Aside: As a dependency of Hypercore, Hyperbee and Corestore.
This needs node-gyp.
Following this, I set the C and C++ ...
1
vote
1
answer
2k
views
cannot create temp file for here-document: No such file or directory
Only other posts about this were 'no space left on device' or 'permission denied' issues.
Trying to run something that uses puppeteer & chromium, which worked flawlessly for a while. Then I ...
0
votes
0
answers
19
views
"No such file or directory" when executable exists with relevant permissions [duplicate]
After installing n to manage node versions on my alpine vm, I am having the following issue where the node executable is not found, despite existing
vscode ➜ /workspaces/tom $ which node -a
/...
0
votes
0
answers
2k
views
NodeJS npm can't access internet. Error Code ETIMEDOUT after a few minutes of freeze
I was trying to install the modules for nodejs project. I ran npm i which for some reason froze at progress bar which is shown when adding modules, after a few minutes it just ended up with an error ...
0
votes
0
answers
128
views
Unable to run npm install on centos7 VPS server
I want to update my node.js project dependencies on VPS server(CentOS7).
I run this command for updating the dependencies:
/opt/cpanel/ea-nodejs16/bin/npm install
but it gives me this message:
/usr/...
0
votes
0
answers
729
views
nodejs process doesn't stop on 'systemctl stop' while running as an Ubuntu systemd service
when trying to stop a nodejs process running from a service file the service is never actually stopped, and just keeps running, forcing me to manually kill the process in htop each time. any ideas on ...
0
votes
0
answers
769
views
Running nodejs as systemd service -
I've tried running a nodejs server on RHEL by running a .js file with node and ran into the issue of being unable to bind to port 80, changing to a higher port fixed this, but I was unable to access ...
1
vote
1
answer
905
views
Run ts-node in systemd service
I'm trying to create a service to run a typescript file.
This is what's in my service file so far:
[Unit]
Description=Service that runs the Parenti Bot
After=network.target
[Service]
Type=simple
User=...
0
votes
2
answers
300
views
Add a new line to the beginning of every file without using sed
I hope this fits in here (I guess it would also be a match for Stack Overflow, since I'm using a nodeJS module) but basically I'm trying to add // @ts-nocheck \n to the beginning of every file with ...
0
votes
1
answer
99
views
How to send new information to STOPped process
Say I have a long-running process, and I stop and restart it using:
kill -STOP <pid>
kill -CONT <pid>
is there a consistent way to alter the running process, either environment variables ...
0
votes
0
answers
84
views
Bash: env in rustup node module not found after logging in
I've used Rustup and Cargo for a Node project, and now I don't need them anymore, so tried removing both. However, each time I connect to the Raspberry Pi in question via SSH, I get this output:
~ $ ...
25
votes
7
answers
131k
views
how to fix missing libcrypto.so.1.1?
I first encountered this problem when I tried to run nodejs on my system. I got this error message:
node: error while loading shared libraries: libcrypto.so.1.1: cannot open shared object file: No ...
0
votes
1
answer
76
views
Best practice for multiple Node applications on one server
I've read that it is the best practive to create seperate system accounts for each application, so in case of a security breach the attacker is isolated inside the specific account and cannot do any ...
0
votes
2
answers
429
views
Installing nodejs in ubuntu via the downloaded file from nodejs website
I have downloaded the nodejs repository from nodejs website and I want to install it via node file in bin directory and I want to install it with gdebi or software installer app but the errors are:
...
0
votes
1
answer
9k
views
Uninstall wine completely
I need to run sudo apt-get update and curl -fsSL https://deb.nodesource.com/setup_16.x | sudo -E bash - to install Node.js. However, I get the following error:
E: The repository 'https://dl.winehq.org/...
1
vote
0
answers
190
views
Symlink npm to pnpm
My understanding is that pnpm is designed to be a drop-in replacement for npm. However, I'm not sure if this is true for all cases.
Is it safe to just delete npm and symlink in pnpm or will that break ...
0
votes
1
answer
106
views
Prometheus DiskTooManyReallocatedSectors
I have Prometheus Alert Manager running on several linux machines. (https://prometheus.io/docs/alerting/latest/alertmanager/)
One of them is reporting 2 reallocated sectors. I got the setup-alert from ...
2
votes
0
answers
678
views
Figuring out which user is best to start pm2
I'm about to deploy a highly secure production server, which is running an nginx reverse proxy, which points to the backend server on nodeJS. When a user starts the server by typing in the "pm2 ...
1
vote
1
answer
6k
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 ...
2
votes
1
answer
4k
views
Automatically restart a process after it exits
I have a javascript program, which runs on nodejs. If I run the following command:
node app.js
It keeps running but sometimes it exits. But I want to start it again automatically when it exits.
Is ...
1
vote
1
answer
769
views
bash/zsh hook - Add to PATH only if no matching file found
I am looking for a bash/zsh hook, that is invoked when a command is not found.
Say I run some arbitrary executable:
xyz foo --bar
say that bash/zsh cannot find the executable.
is there a way to handle ...
0
votes
1
answer
213
views
adding node.js directory to cygwin path breaks the ls command
adding node.js directory to cygwin path breaks the ls command:
Starting /bin/bash.exe
myidt@DESKTOP-IV5C6TI /cygdrive/d/tmp/node_ls_ko
$ touch toto
user@DESKTOP /cygdrive/d/tmp/node_ls_ko
$ ls
toto
...
1
vote
1
answer
810
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....
0
votes
0
answers
229
views
cant run react nginx on port 443 and 80 both are in used
I have react, nodejs app and dockerize them.
frontend running with Nginx on port 80 and 443 on my local docker-machine.
when I run the docker-compose command on my VPS centos it throws an error that ...
0
votes
1
answer
3k
views
npm install failling at node-gyp rebuild and libpq
> [email protected] install /home/johnsoct/bobtail/node_modules/libpq
> node-gyp rebuild
/home/johnsoct/.nvm/versions/node/v12.22.4/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin/node-...
2
votes
1
answer
1k
views
Force apt-get to install later version of nodejs
I am on Debian 11, fully up to date (apt-get update && apt-get upgrade && apt-get dist-upgrade). I previously installed nodejs version 12.22, since that is what is in the Debian repo, ...
2
votes
1
answer
2k
views
Why do I get this extra quote in an env variable defined in /etc/environment?
In our CentOS server, the env variable NODE_OPTIONS was set to a wrong value. I checked some possible files such as /etc/environment, /etc/profile, but no luck. I also tried to grep it from /etc/, ...
1
vote
0
answers
959
views
vs-code terminal vs linux terminal shows different node --version
I upgraded node with "nvm" in kali-linux system:
nvm install node
This installs latest node version. nvm ls displays this
default -> v14.15.1
v15.14.0
v16.2.0
v16.3....
1
vote
1
answer
682
views
Cron task not running
I've configure a cron task for running a NodeJS script everyday.
crontab -l
# Edit this file to introduce tasks to be run by cron.
#
# Each task to run has to be defined through a single line
# ...
0
votes
0
answers
257
views
Npm won't install SOCKET.io due to Node version?
I need to install socket.io for my node program. So, whenever I try to install socket.io by running the following commandline instruction, it says node version needs to be greater than or equal to 10 ...