Mongo DB - Cannot find module 'express'

Mongo DB - Cannot find module 'express'
0

#1

Tell us what’s happening:
When trying to go through the mongoDB challenges, this error in Glitch prevents me from running the code:

Error: Cannot find module ‘express’

at Function.Module._resolveFilename (module.js:547:15)

at Function.Module._load (module.js:474:25)

at Module.require (module.js:596:17)

at require (internal/module.js:11:18)

at Object. (/app/server.js:6:15)

at Module._compile (module.js:652:30)

at Object.Module._extensions..js (module.js:663:10)

at Module.load (module.js:565:32)

at tryModuleLoad (module.js:505:12)

at Function.Module._load (module.js:497:3)

Your code so far

{
  "name": "fcc-mongo-mongoose-challenges",
  "version": "0.0.1",
  "description": "A boilerplate project",
  "main": "server.js",
  "scripts": {
    "start": "node server.js"
  },
  "dependencies": {
    "express": "^4.16.3",
    "body-parser": "^1.18.3",
    "mongodb": "^3.4.13",
    "mongoose": "^5.2.9"
  },
  "engines": {
    "node": "4.4.5"
  },
  "repository": {
    "type": "git",
    "url": "https://hyperdev.com/#!/project/welcome-project"
  },
  "keywords": [
    "node",
    "hyperdev",
    "express"
  ],
  "license": "MIT"
}


Your browser information:

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

Link to the challenge:
https://learn.freecodecamp.org/data-visualization/data-visualization-with-d3/add-axes-to-a-visualization


#2

Could you post a link to your Glitch project here?


#3

my guess is you forgot to import it

usually its something like require('express') at the top of your code


#4

#5

I’m having the same issue. Seems like from looking at his code he found a way to fix it but I have basically the same thing and I’m still getting the error. I did require(“express”).

https://phase-flyingfish.glitch.me