Nodejs } Problem in connecting with localhost : Error 404

I am trying to start a file server under node.js using the following command on my terminal :


$ npx serve -p 5050 static


Above command works and generate a display box on terminal.

Example like the following :



But it doesn't work and generate 404 error after I copy and paste "http://localhost:5050" on safari address bar.


Following method tried :

  • turn off of firewall -> Doesn't work
  • change code to "$ npx serve -p 3000 static" on terminal --> Doesn't work


Is there anyone whom knows what goes wrong?

MacBook Pro 14″, macOS 14.4

Posted on Mar 17, 2024 8:58 AM

Reply

Similar questions

2 replies

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Nodejs } Problem in connecting with localhost : Error 404

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.