Information Security with HelmetJS - Install and Require Helmet

Tell us what’s happening:

I can’t understand what problem this is. The test said ‘helmet version 3. 21. 3 should be in package.json’. But the explanation says that helmet is installed, so that I should only require helmet, and I did it in the third line like this: “const express = require(‘helmet’);” What is the problem?

###Your project link(s)

solution: https://freecodecam-boilerplate-scspmu4xwd2.ws-us116.gitpod.io

Your browser information:

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

Challenge Information:

Information Security with HelmetJS - Install and Require Helmet

The link you provided doesn’t appear to exist.

However, this is not the correct way to require helmet:

You should have a line of code which requires express:

const express = require('express');

Below that, you should have a separate line of code which requires helmet, using the same syntax but using the variable name helmet.

Thanks for your reply, @igorgetmeabrain. I’ll change the part.

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