Help needed on: Information Security with HelmetJS - Understand BCrypt Hashes

I’m currently working on this challenge:
https://learn.freecodecamp.org/information-security-and-quality-assurance/information-security-with-helmetjs/understand-bcrypt-hashes

When submitting the url (https://s-project18-6-2.glitch.me/), I got the following error:
You should correctly require and instantiate socket.io as io.

I find that irritating. If I look at the bcrypt-examples here:
https://www.npmjs.com/package/bcrypt
then there are no hints about socket.io

Nevertheless I added socket.io to dependencies and required them,
but the error remains.

The glitch-console did not show any errors, just:
requested

Infos:
I created a glitch-project based on this link:
https://glitch.com/#!/import/github/freeCodeCamp/boilerplate-bcrypt/

My package.json changes:

...
  "dependencies": {
    "express": "^4.17.1",
    "cors": "^2.8.5",
    "body-parser": "^1.19.0",
    "mongodb": "^3.2.7",
    "helmet": "^3.20.0",
    "bcrypt": "^3.0.6",
    "socket.io": "^2.2.0"
  },
  "engines": {
    "node": "10.16.2"
  },
  ...

Changes in server.js:

const express     = require('express');
const bodyParser  = require('body-parser');
const fccTesting  = require('./freeCodeCamp/fcctesting.js');

const bcrpyt = require('bcrypt');
const io = require('socket.io');
//const server = require('http').createServer();
//const io = require('socket.io')(server);
const app         = express();
fccTesting(app); //For FCC testing purposes
...

Has anyone an idea what I did wrong? Thanks

I don’t believe it, a typo:
bcrypt = require('bcrypt');

I looked 50 times about that code…

1 Like