Basic Node and Express - Meet the Node console

Tell us what’s happening:

Hi there again

I’m working on the “Meet the Node Console” challenge from the FreeCodeCamp backend section, and I’m a bit stuck :sweat_smile:

I’ve cloned the GitHub repo into Glitch and added console.log(“Hello World”); in my myApp.js file as asked. But when I run the tests, it still says:

“Hello World” should be in the console

I also tried checking the Glitch logs but didn’t see anything helpful. Not sure what’s wrong or what I’m missing :confused:

Any idea why this error is showing? Appreciate any help

Your project link(s)

solution: Glitch :・゚✧

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/135.0.0.0 Safari/537.36

Challenge Information:

Basic Node and Express - Meet the Node console

did you restart the server?

Yup, I restarted the server, but it still didn’t work :confused:

then try write below the line with let app, not on the first line of the file

First, I added it after let app, but it wasn’t being read or was still throwing an error. So, I moved it to the top to make sure it’s being read correctly.

and what error was it throwing?

// running tests
1. "Hello World" should be in the console
// tests completed
// console output
[Error]

the browser console may show something more, what does it say there?

the first error is cut off, what is there higher on the console?

[OPTIMIZELY] Error:
optimizely object is not valid. Failing isFeatureEnabled.
index.930fab95.js:59

will try to open idb now: content
content.bundle.js:55109
7.366943359375 ms

Runtime lastError: Unchecked runtime.lastError: The message port closed before a response was received.

Failed to load resource: net::ERR_FILE_NOT_FOUND
chrome-extension://lopnbnfpjmgpbppclhclehhgafnifija/aiscripts/script-main.js:1

Blocked URL:
https://www.google.com/recaptcha/api2/anchor?ar=1&k=6LcqF6gZAAAAAHE-lzA_9GAux7eX9OHaQ5VdEo0C&co=aHR0cHM6Ly9nbGl0Y2guY29tOjQ0Mw..&hl=en&v=ItfkQiGBlJDHuTkOhlT3zHpB&size=invisible&cb=wv5xg4i7t5x8
Blocked iframe

Blocked URL:
https://api.glitch.com/console/8a53bc72-4b81-45f6-b428-5c7332cbffa8/
Blocked iframe

Blocked URL:
https://api.glitch.com/console/1f7d8fa4-376a-48b0-bc2d-d7a6be10f3e1/
Blocked iframe

WebSocket is already in CLOSING or CLOSED state.
index.930fab95.js:95

Refused to load the stylesheet because it violates the Content Security Policy directive: "style-src 'self' 'unsafe-inline' https://cloud.webtype.com https://d10lpsik1i8c69.cloudfront.net cdn.glitch.com cdn.glitch.me cdn.glitch.global cdn.staging.glitch.com cdn.staging.glitch.me cdn.staging.glitch.global cloud.typenetwork.com"
https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500&display=swap

Refused to load the stylesheet because it violates the Content Security Policy directive: "style-src 'self' 'unsafe-inline' https://cloud.webtype.com https://d10lpsik1i8c69.cloudfront.net cdn.glitch.com cdn.glitch.me cdn.glitch.global cdn.staging.glitch.com cdn.staging.glitch.me cdn.staging.glitch.global cloud.typenetwork.com"
https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500&display=swap

Refused to load the stylesheet because it violates the Content Security Policy directive: "style-src 'self' 'unsafe-inline' https://cloud.webtype.com https://d10lpsik1i8c69.cloudfront.net cdn.glitch.com cdn.glitch.me cdn.glitch.global cdn.staging.glitch.com cdn.staging.glitch.me cdn.staging.glitch.global cloud.typenetwork.com"
https://fonts.googleapis.com/css2?family=Inter:wght@100..900&family=Roboto+Mono:ital,wght@0,100..700;1,100..700&display=swap

isCacheTxt: false
contentScript.bundle.js:54039
isCacheTxt: false
contentScript.bundle.js:54040

can you format that please?

I don’t know why there is that error, you could try to develop locally and see if it makes it go away

or wait for some other people to take a look

Open the terminal (Terminal button in the editor footer) and enter enable-npm. Wait for it to finish, then submit the link you get from the preview (use the three dots menu next to the preview).

Your code should pass.

Hmm, there are two scenarios I’m seeing:

  1. If I place the console.log("Hello World") after let app, the test still doesn’t accept it.
  2. If I place it at the very top, it just returns:
// running tests
1. "Hello World" should be in the console (Test timed out)
// tests completed

I didn’t have to change any code to make it pass. Only making sure Glitch is not in an error state by doing what I said. I remixed your code, and it was passing for me (after the npm fix).

Also, make sure you are not submitting the editor link, but the actual live app link.

1 Like

Well, it didn’t work either way, but strangely, I just repasted the URL and it worked. Not sure how or why — the URL didn’t even change. Still a mystery.

Well, if it works, it works. Who knows why code sometimes break.

Just as an aside, you could also complete these challenges locally. Just run the server locally and submit the localhost link http://localhost:3000 (or whatever port the server is started on). It works for all challenges, but certificate projects also needs a live link (or just a repo, not sure if we changed that).

1 Like