Some error on creating a repl

I created a repl for the information security course. I added my “require helmet” and used npm i helmet@3.21.3 to add it. I even manually changed my package.json to have exactly that version. However, the tests started saying “timed out”. I tried opening the repl, but in the end, it gave me this error:

connecting to your repl... connected!  Server starting up

boilerplate-infosec-1@1.0.0 start /home/runner/boilerplate-infosec-1
node server.js

/home/runner/boilerplate-infosec-1/node_modules/express/lib/router/index.js:458
throw new TypeError('Router.use() requires a middleware function but got a '+ gettype(fn))
^

TypeError: Router.use() requires a middleware function but got a Object
at Function.use (/home/runner/boilerplate-infosec-1/node_modules/express/lib/router/index.js:458:13)
at Function. (/home/runner/boilerplate-infosec-1/node_modules/express/lib/application.js:220:21)
at Array.forEach ()
at Function.use (/home/runner/boilerplate-infosec-1/node_modules/express/lib/application.js:217:7)
at Object. (/home/runner/boilerplate-infosec-1/myApp.js:55:5)
at Module._compile (internal/modules/cjs/loader.js:999:30)
at Object.Module._extensions…js (internal/modules/cjs/loader.js:1027:10)
at Module.load (internal/modules/cjs/loader.js:863:32)
at Function.Module._load (internal/modules/cjs/loader.js:708:14)
at Module.require (internal/modules/cjs/loader.js:887:19)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! boilerplate-infosec-1@1.0.0 start: node server.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the boilerplate-infosec-1@1.0.0 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-04-01T02_45_59_839Z-debug.log
exit status 1

solution: https://boilerplate-infosec-1.sadeshmukh.repl.co

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.114 Safari/537.36.

Challenge: Install and Require Helmet

Link to the challenge:

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.