Nest JS server returning 404 response to all the routes after changing node JS version on my machine - node.js

I am running my Nest JS application on my local server's PORT 3000 and my node version is 16.5.0. My application has multiple routes and all were giving correct responses. There was a requirement where I had to downgrade the node version to 14.17.0. After this change, I started my server again and here the problem comes. All the routes started giving the response like POST /user 404 not found and GET /user/:id 404 not found.
I have reverted back to node version 16.5.0 and removed the node_modules and re-installed it again and restarted the server as well. But still, I am getting the same issue.

All the approaches I tried above failed to resolve the issue. The only way which resolved the issue is by restarting the system and running the server again.

Related

How to find out why I get 500 error from Firebase on server but not on localhost

I try to run my first node application on my server from subdomain. It works perfectly on my PC but when I move it to the server, seems everything works, site loads with all js except Firebase.
I get the following errors in chrome:
/firebase/firestore net::ERR_ABORTED 500 (Internal Server Error)
/firebase/app net::ERR_ABORTED 500 (Internal Server Error)
The 2 lines of my my .js triggers the error:
import firebase from '/firebase/app';
import '/firebase/firestore';
Obviously it can mean millions different issues but I have no idea how to find any logs or anything what would tell me why this error triggered.
I tried to turn off/on https. I checked logs on server but found nothing just the same 500 error in access log. I tried but couldn't find any node specific log on the server. I tried to re-install firebase. After I tried to re-install node and everything and re-started from scratch.
I tried to copy the whole node_modules folder to the server from my PC but didn't help.
I would expect it to run just as on localhost or at least see some log about the error so I could fix it. The server is Linux VPS with plesk obsidian. The app is on a subdomain, the main domain has php website running.

The Nginx server returns error 502 for some directories (Express Application)

I'm running an express application using nginx web server on Ubuntu. everything works fine but today when I added two more directories using app.get method and re-deploy my app, the new directories won't work and it returns 502 Bad Gateway errors (old directoriesn are working fine). Restarting pm2, nginx and the server itself didn't help. What should I do?
After a couple of hours I realized that the problem was in my code and not relevant to nginx. But because of pm2 the server would not crash to help me find that out.
running normal run command:
node server.js
revealed the mistake

Express server unable to proxy to my React project

I have an issue, my server is giving me an error that it is unable to proxy from localhost:8080 to localhost:3000 on my local machine, it also showed a Http parse error together.
I am trying to run a React and Express project and it worked when I used cloud9 to run it.

automatic unwanted continuous anonymous socket calls /socket.io/?EIO=3&transport=websocket

I'm getting continuous automatic unwanted anonymous socket calls GET /socket.io/?EIO=3&transport=websocket 404 on my nodeapp.
I've not implemented any socket module in code.
So my question is why I'm getting this 404 requests?
Code was working on Centos6, I've just switched to Centos7 installed node 0.12.2 and tried running code using node bin/www command.

unable to run express 2.5.8 on ubuntu 11 on amazon aws

I am using express 2.5.8 on ubuntu 11 (amazon aws). I have connect 1.7.2 & node 0.6.15. I am able to run node (listen on port 3000 for instance) - however, when I use express, it appears to throw the following error:
got an uncaught error: Uncaught, unspecified 'error' event
There is no other service bound on that port at that time - I have tried re-installing express 2.5.8 and connect 1.7.2 (work on local box) - any insight to troubleshoot the issue more quickly will be greatly appreciated. Once again, the code (using express runs fine on local box - on server, I can run a non express node server on that same port (I close it down before I run the express server instance).
Thanks
Pilot error - the issue was with the redis connection pwd (I had to fix it in my code to match the pwd in the redis.conf to resolve the issue ). Added better handling (which I should have done to begin with).
Thank you Wes for commenting - appreciated.

Resources