Tell us what’s happening:
Hi, I did everything step by step with the guide but it returned the following error code. I then tried to copy the model answer to my server.js and it also returned the same error code. What’s wrong?
/home/runner/boilerplate-advancednode-1/server.js:17
const MongoStore = require('connect-mongo')(session);
^
TypeError: require(...) is not a function
at Object.<anonymous> (/home/runner/boilerplate-advancednode-1/server.js:17:44)
at Module._compile (internal/modules/cjs/loader.js:1138:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1158:10)
at Module.load (internal/modules/cjs/loader.js:986:32)
at Function.Module._load (internal/modules/cjs/loader.js:879:14)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)
at internal/main/run_main_module.js:17:47
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! fcc-advanced-node-and-express@0.0.1 start: `node server.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the fcc-advanced-node-and-express@0.0.1 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/runner/.npm/_logs/2021-02-25T03_41_40_750Z-debug.log
exit status 1
Your project link(s)
https://repl.it/@kwan19961217/boilerplate-advancednode-1#server.js
Your browser information:
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.182 Safari/537.36
.
Challenge: Learn How JavaScript Assertions Work
Link to the challenge: