Exercise asking for a previous version of Helmet

Tell us what’s happening:
the current version of Helmet is 4.1.1 and the exercise if looking for version 3.21.3 I get this msg helmet version 3.21.3 should be in package.json

I cannot find out how to install an earlier version of Helmet.
any help would be appreciated I tried it on edge and chrome same error,

Your code so far

Your browser information:

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

Challenge: Install and Require Helmet

Link to the challenge:

Just open package.json and change version.
Or install exact version:

npm i helmet@3.21.3

thanks for your reply to my question, I have ran the above command and made sure the correct code is in myApp.js but I still get the message, helmet version 3.21.3 should be in package.json


Hi @Gee-Max. Try changing the version of helmet in package.json manually so that it becomes "helmet": "^3.21.3". Save and click run.

Then you’re probably submitting the wrong repl.it link. Try the one from the preview pane.

tried it with both links same outcome,
what is it that you have to put in the myApp.js file ?
this is what I am putting in there.

const helmet = require(‘helmet’);

Hi nibble, I have tried that it didn’t work.

Welcome, Gee-Max.

The version number cannot have any carets (^) or tildes (~).

This command should help:

npm install --save-exact helmet@3.21.3

Hope this helps

Hi @Sky020 this worked thanks very much, how come it didn’t work when it included the caret(^) before the version number ?


Unfortunately, it is the way the tests have been written:

text: '<code>helmet</code> version <code>3.21.3</code> should be in <code>package.json</code>'
    testString: getUserInput => $.get(getUserInput('url') + '/_api/package.json').then(data => { var packJson = JSON.parse(data); assert(packJson.dependencies.helmet === '3.21.3' ); }, xhr => { throw new Error(xhr.responseText); })

We are planning on fixing this.

Ah ok, thanks for your help

pls help me i’m having the same problem my version of helmet in package.json has no caret yet when i submit on freecodecamp, it still says

helmet version 3.21.3 should be in package.json
this is my repl.it  https://repl.it/@gloryeziani/boilerplate-infosec#myApp.js

pls help!!

See this previous challenge.