Helmet, cache issue or code problem?

Tell us what’s happening:
Like some other users, I am having trouble with the initial helmet.hidePoweredBy() question. I am using Repl.it. I have noticed a few things. 1) Clearing my cache isn’t working (is it a server issue?). 2) I have waited days between submitting the answer. 3) My starting code is not the same as others I see in posts (i.e. no initial comments in the code line from FCC). I did not delete or change anything. Can I start the module over from scratch? 5) Maybe my code is wrong? I have tried so many different ways. it is hard to tell because they all give the same answer, “helmet.hidePoweredBy() middleware should be mounted correctly” 6) FCC states you can add a fake x-powered-by header, which, according to helmet is not possible:
“This middleware takes no options.
If you’re using Express, this middleware will work, but you should use app.disable(“x-powered-by”) instead.”


Your code so far
var express = require(‘express’); // Do Not Edit
var app = express(); // Do Not Edit
var helmet = require(‘helmet’);

Your browser information:

User Agent is: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0.

Challenge: Hide Potentially Dangerous Information Using helmet.hidePoweredBy()

Link to the challenge:

I don’t think the correct version of helmet is installed.

  1. Uninstall it, run npm rm helmet in the console.

  2. Install the correct version run npm i helmet@3.21.3 in the console. Edit: you can also use the -E flag to get the exact version npm i -E helmet@3.21.3

Now try to submit again. If it fails, try a few times. I did this to a fork of your project and it passed.

1 Like

Thank you for the response.

Did the uninstall/reinstall (with -E) and no change. When I open a fork and run I get "Error: Cannot find module ‘express’ ".

Just worked! I don’t know if it was a timing issue or what. I actually ran “npm install helmet --save” and on the second time submitting the URL to FCC it worked. Any thoughts?