Information Security with HelmetJS - Install and Require Helmet

My code does not seem to go through

Your project link(s)
const package.json = require(“helmet”);

solution: boilerplate-infosec - Replit

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/116.0

Challenge: Information Security with HelmetJS - Install and Require Helmet

Link to the challenge:

const package.json = require("helmet");

You should assign it to a helmet variable.


As an aside:

package.json is a file on disk that contains the dependencies and scripts (among other things). You are trying to use it as if it was an object with a property on it. For one, the object doesn’t exist in your code, secondly, you can’t do an assignment to a property when declaring an object.

const obj.prop = 'test'
Uncaught SyntaxError: Missing initializer in const declaration
const obj = {}
obj.prop = 'test'
console.log(obj.prop) // test
2 Likes

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