Skip to main content
Share Your Experience: Take the 2024 Developer Survey
50 votes

Docker COPY issue - "no such file or directory"

For me the directory was in the correct context, only it was included in the (hidden) .dockerignore file in the root of the project. This leads to the error message: lstat mydir/myfile.ext: no such ...
AlcaDotS's user avatar
  • 601
20 votes

map directive is not allowed here

Try adding this to your nginx.conf in the http {}: user www-data; worker_processes auto; pid /run/nginx.pid; events { worker_connections 768; # multi_accept ...
ryekayo's user avatar
  • 472
17 votes
Accepted

docker-compose for nginx and nodejs server

You use the container's name as you defined it in docker-compose.yml. Docker provides the IP addresses for the named containers via DNS within each container, and updates them if the containers are ...
Michael Hampton's user avatar
12 votes
Accepted

Checking file's existence by name in a GCS bucket with Node.js

They added the file.exists() method. const fileExists = _=>{ return file.exists().then((data)=>{ console.log(data[0]); }); } fileExists(); //logs a boolean to the console; //true if the ...
Lex's user avatar
  • 191
9 votes

Centos 7 Can't yum install npm

On Centos 7, for installation of npm and nodejs, follow these steps 1. Open terminal 2. Run these commands (With sudo or root) yum install epel-release yum install npm nodejs
Hafiz Muhammad Shafiq's user avatar
9 votes

Docker COPY issue - "no such file or directory"

For me the issue was that I was using docker build - < Dockerfile From the documentation Note: If you build using STDIN (docker build - < somefile), there is no build context, so COPY can’t be ...
Adam's user avatar
  • 91
9 votes

How to configure Systemd service unit to start Node app with "npm start" instead of "app.js"

I'm running a similar setup on Debian, and my service looks like this: ... [Service] Environment=NODE_PORT=3000 Type=simple User=www-data Restart=on-failure WorkingDirectory=/var/www/<your-code-...
filipe's user avatar
  • 191
7 votes
Accepted

Node-sass error during installation of node modules

Solution is npm install --no-optional
Emil Moe's user avatar
  • 209
7 votes

ADFS Error - MSIS9605: The client is not allowed to access the requested resource

On Windows Server 2016 you need to explicitly grant clients permission to a resource, even when the access policy is set to "Permit everyone". Try this command: Grant-AdfsApplicationPermission -...
Tu Dinh's user avatar
  • 171
7 votes
Accepted

Cron job vs NodeJS setInterval for optimal performance

Advantages of cron solution less memory consumption for 90% of the time memory leaks are effectively eliminted the code is reloading all libraries every time so updates take effect on the next run ...
chicks's user avatar
  • 3,829
6 votes
Accepted

Why is my bash script terminating?

Your script name has "node" in the name and pkill node is probably killing it. Using pkill -x node to kill only processes whose name is exactly "node" might be more to your liking. Or even pkill -f -...
chutz's user avatar
  • 8,030
6 votes
Accepted

Should I be concerned about attackers spraying for vulnerabilities on our webserver?

This is perfectly normal internet background noise. As long as you keep your applications updated and endpoints known, there is no need to worry. If you want to filter the traffic from entering your ...
Tero Kilkanen's user avatar
5 votes

How do you install Node.JS on CentOS?

Run as root on RHEL, CentOS or Fedora, for Node.js v4 LTS Argon: curl --silent --location https://rpm.nodesource.com/setup_4.x | bash - Alternatively for Node.js v5: curl --silent --location https:/...
itzhar's user avatar
  • 151
5 votes
Accepted

Permissions setup for nodejs

Assuming that your application doesn't need write access to the application data (which it really shouldn't), we do the following: We break the users into two classes - node-<app>-runtime and ...
Brennen Smith's user avatar
5 votes

"/usr/bin/env node: No such file of directory" - only under Supervisor

if you are using nvm node version manager, use this comment to create a symlink: sudo ln -s "$(which node)" /usr/bin/node
Mohammad Rajabloo's user avatar
5 votes
Accepted

NodeJS React Systemd Service not working

I encountered the same problem after an upgrade, my systemd service started exiting with error code 0 every time it was started. This is due to a February update to react-scripts start.js Kolega's ...
user568722's user avatar
4 votes

AWS Elastic Beanstalk - Node not found after creating NodeJS instance

The AMI image by default doesn't add node to the bash PATH. You can add a symlink in /bin, pointing at node using the following bash command. sudo ln -sf `ls -td /opt/elasticbeanstalk/node-install/...
Jozzhart's user avatar
  • 171
4 votes

Allowing node.js applications to run on port 80

FWIW, another option is to use authbind. Authbind uses a slightly different mechanism to achieve similar ends to CAP_NET_BIND_SERVICE. I.e. allows non-privileged apps to use privileged ports. ...
Jeremy Davis's user avatar
4 votes
Accepted

Appengine stuck on "Updating service [default]..."

When you get this error, you can take a look at crash.log in the Cloud Console Logs Viewer (Logging -> Logs) for your specific service / version which will usually tell you exactly what happened. In ...
Adam's user avatar
  • 878
4 votes
Accepted

Running a HTTPS Node.js server as non-root

The certificates problem is easy to fix, just chown them to your user and adjusting the permissions accordingly. You'll find though that you can't make your server listen to the HTTPS port, 443, as ...
Fredi's user avatar
  • 2,287
4 votes

Is it safe to pass my ssl key and cert files to socket.io?

This is code you're running on your own system. If you don't trust it, then don't give it access to secrets. If you do trust it, then go ahead. Short of paying for a full security audit of the code, ...
EEAA's user avatar
  • 110k
4 votes

Where should I write my database credentials in node.js app?

You should never put the credentials in any file that goes to the source code repository. What is usually done is to use environment variables that are set using a control panel of your hosting ...
rsp's user avatar
  • 241
4 votes
Accepted

What might be causing repeated mmap/munmap in strace results?

All that can be deduced from this output is that the application is allocating and freeing memory. So there must be some data structures which are growing and shrinking. That unfortunately doesn't ...
kasperd's user avatar
  • 30.7k
4 votes
Accepted

"_*" headers not seen through NGINX reverse proxy

Found the problem - json web token had an underscore included in the variable name - and nginx removes the whole variable. Fix: underscores_in_headers on;
Neo Neo's user avatar
  • 59
4 votes
Accepted

nginx configuration for subdomain and proxy server

You configured your proxy for location /api { # ... } So it is only reachable with https://api.mywebapp.com/api/. You most probably want to change this to location / { proxy_pass http://...
Gerald Schneider's user avatar
4 votes
Accepted

Nginx content-type with proxy_pass

Solved with proxy_pass_header Content-Type; no idea why nginx would hide the header.
Max0999's user avatar
  • 223
4 votes
Accepted

what can cause Nginx "Connection reset by peer" when upstream is healthy?

It looks like your NodeJS app is sending RST packet to nginx for some reason. You could try tcpdump and/or strace to capture network traffic and syscalls around the time the error happens; then ...
Juraj Martinka's user avatar
4 votes

how to fix apache2 "proxy_http:error" AH01102: error reading status line from remote server localhost:4382

If you look at your log, first appear (70007)The timeout specified has expired: [client 178.153.198.97:52385] AH01095 the rest of the log is a kind of consequence of that. What is happening here is ...
Maria Mercedes Wyss Alvarez's user avatar
4 votes

How can I get node18 on amazonlinux2?

The answer at: Node.js 18 is compiled for glibc 2.28 is certainly correct although highly unsatisfying. You cannot run the binary on your system because it relies on a version of glibc which is not ...
Bodo Hugo Barwich's user avatar
4 votes

How can I get node18 on amazonlinux2?

Building up on the answer by Bodo Hugo Barwich and the comment by Rich: If you do not want to use the Docker image public.ecr.aws/lambda/nodejs:18 directly, you can copy node from that image to your ...
udondan's user avatar
  • 2,099

Only top scored, non community-wiki answers of a minimum length are eligible