Challenge Keeps Failing - Add Helmet to Glitch Project

Challenge Keeps Failing - Add Helmet to Glitch Project
0

#1

I’ve added Helmet to the package.json file as a dependency, but the challenge keeps failing. I get the message ‘“helmet” dependency should be in package.json"’… does anyone know why? I’ve never gotten this issue with any other Glitch project I’ve created so far for the other challenges.

Thanks!


#2

Nevermind I figured it out.


#3

What was going wrong for you?

I’m stuck in the first lesson - Information Security with HelmetJS - Install and Require Helmet. I’ve reviewed my code over a week now and can’t seem to figure out what’s wrong.

I installed the dependency in my package.json file:

{
“name”: “fcc-infosec-challenges”,
“version”: “0.0.1”,
“description”: “fcc backend boilerplate”,
“main”: “server.js”,
“scripts”: {
“start”: “node myApp.js”
},
“dependencies”: {
“express”: “^4.14.0”,
“helmet”: “^3.8.1”
},
“engines”: {
“node”: “4.4.5”
},
“keywords”: [
“node”,
“hyperdev”,
“express”,
“freecodecamp”
],
“license”: “MIT”
}

And required helmet in myApp.js file like so:

/**********************************************

    1. Applied InfoSec Challenges
  • =============================
    ***********************************************/

var express = require(‘express’); // Do Not Edit
var app = express(); // Do Not Edit

// ----

/** - Challenges - *
********************/

/** 1) Install and require helmet */

// Helmet helps you secure your
// Express apps by setting various HTTP headers.
// Install the package, then require it.

var helmet = require(‘helmet’);

Thank you!


#4

After many repetitive and enduring tries, it came down to this:

Switched from Google Chrome to Safari and the test passed.

:alien:


#5

Wow, I just got stuck on this one too! I tried switching browsers but it didn’t help.

Without changing any code, I realized the URL was the problem:
https://... works and
http://... doesn’t.