Basic Node and Express - Start a Working Express Server - rJMhx_GUa07-55SRKWKgc

Tell us what’s happening:
I’m not getting a result
Describe your issue in detail here.

Your code so far

let express = require("express");
let app = express();
app.get("/", (request, response) => {
  response.send("Hello Express");
});

My Glitch

Your browser information:

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

Challenge: Basic Node and Express - Start a Working Express Server

Link to the challenge:

Something has gotten messed up on your Glitch project. I tried remixing it and was unable to resolve the problem. I suggest starting over by importing https://github.com/freeCodeCamp/boilerplate-express.git into Glitch again in a new project.

Then, go to the Terminal and type enable-npm. It will refresh the server. Then you should be able to click on the refresh button beside the live url above the preview pane and see Hello Express appear`. This will mean everything installed correctly.
image

Still not working. is there a problem with the server?

im going to try it again

You mean freeCodeCamp? Not that I am aware of. What errors are you seeing in the console when you try to run your project. I could be wrong, but I feel you may have missed a step I suggested because I repeated the steps 5 times when importing the repo into Glitch with no issues.

If you would like, you can join me on Zoom and you can share your screen while I watch you follow the steps in case I notice anything out of the ordinary. We can just use the chat feature without audio or video.

maybe i should start over and us replit

It is up to you. I can walk you through either site. repl.it currently has issues to as you already know.

ok im going to try it in replit

are there other sites to try? I cant get those to work.

the erros im getting:
npm start

start
node server.js

 npm start

start
node server.js

 npm start

start
node server.js

 npm start

start
node server.js

 npm start

start
node server.js

 npm start

start
node server.js

 npm start

start
node server.js

 npm start

start
node server.js

 npm start

start
node server.js

node:internal/modules/cjs/loader:936
throw err;
^

Error: Cannot find module ‘express’
Require stack:

  • /home/runner/boilerplate-npm-3/server.js
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
    at Function.Module._load (node:internal/modules/cjs/loader:778:27)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at require (node:internal/modules/cjs/helpers:94:18)
    at Object. (/home/runner/boilerplate-npm-3/server.js:9:15)
    at Module._compile (node:internal/modules/cjs/loader:1101:14)
    at Object.Module._extensions…js (node:internal/modules/cjs/loader:1153:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:79:12) {
    code: ‘MODULE_NOT_FOUND’,
    requireStack: [ ‘/home/runner/boilerplate-npm-3/server.js’ ]
    }
    exit status 1
     ^C

That’s from replit and I only add the author’s name with my name.

You can also give CodeSandbox a try.

OK. For anyone trying to use Glitch for the Basic Node and Express project, the following shows you how to import the repo, enter the enable-npm command in the terminal, type the code (using @royalgreen50’s solution), and finally refreshing the app to get Hello Express to appear in the preview.

The only thing I do not show is copying/pasting the live url above the preview pane and submitting in successfully on the freecodecamp.org site.

Notes:

  1. This is just for Glitch and just for this set of challenges, though the process should work for the other back end Node challenges and projects.
  2. You can right-mouse click on the image below and select Open image in new tab in Chrome to see a larger version of the it.
    node-express-boilerplate

I followed your video and found out I needed to type enable-npm not enable npm. it reloaded fine but in the result, it reads not found. I guess I will have to learn how to Zoom in the morning. :man_shrugging:

You have to click the Refresh button directly to the right of the live url after changing the code.

yep i did that just like your video but I know I did something different

Like I stated before, you need to start a new project instead of trying to salvage your existing one. The screenshot you show above is the same project from earlier today that I told you was messed up and can not be fixed. My video was for creating a brand new project from the boilerplate repo.

glitch is stating that on its own I guess it saves it so how do I remove it from my dashboard.

Are you using Sandbox if so how did you get the boilerplate in the sandbox. is there a link like in past courses?

??? What do you mean? What is the new project url if it is not the one you posted at the top of this topic?