Information Security with HelmetJS - Install and Require Helmet

Tell us what’s happening:
helmet version 3.21.3 should be in package.json
this error occur in my first challange, help me to resolve this

Your project link(s)

solution: boilerplate-infosec - Replit

Your browser information:

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

Challenge: Information Security with HelmetJS - Install and Require Helmet

Link to the challenge:

Hi there and welcome to our community!

Helmet version 3.21.3 has already been installed, so require it as helmet in myApp.js .

You haven’t required it.

Also you have overwritten the starting express code.

const express = require('helmet');
const app = helmet();

express is supposed to be what you get from requiring in express

app is supposed to be what express() returns. You can’t app.use() with what helmet() returns.

Keep the starting code as is.

const express = require('express');
const app = express();

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