Basic Node and Express - my Node console DOES print Hello World

Tell us what’s happening:

My myApp.js file has this:

var express = require(‘express’);
var app = express();
console.log(“Hello World”);
module.exports = app;

and the cmd console reads:

fcc-learn-node-with-express@0.1.0 start
node server.js
Hello World
Node is listening on port 3000…

What am I doing wrong?

Your browser information:

User Agent is: Chrome/147.0.7727.56

Challenge Information:

Basic Node and Express - Meet the Node console

Hi @andie.perez.chavez

Are you running the project locally? If you’re, I also experienced a similar issue in chrome. I suppose other chromium derivatives like Brave and Edge will exhibit similar behavior. I’m not sure about other browsers.

I noticed the request from FCC to localhost is being blocked due to CORS policy. You should see this when you open the browser console. The reason this happens is because, by default, under the Local Network Access restrictions, chrome disallows requests to local networks, including loopback address 127.0.0.1(also known as localhost) on which your solution is running.

Ideally, FCC is supposed to request explicit permission from you the user before making a request to a service running on your local network. However, this has to be implemented on the FCC codebase.

Meanwhile you can disable the restriction in the settings at chrome://flags#local-network-access-check. If you’re using other chromium based browsers like brave, simply replace the chrome: scheme with brave:. The test should pass.

@jwilkins.oboe, perhaps it’s high time we updated the How to run the freecodecamp backend challenges locally article to include how to get around this browser behavior.

You can read more about the Local Network Access(LNA) api here: