BCrypt should be properly required

Tell us what’s happening:
I’ve tried multiple times to import/require BCrypt in the server.js as said in the problem description and also tried on the mainApp.js file. Always fails.

While testing it detects that BCrypt is installed but says that I’m not requiring it properly.

Can someone help?

Your code so far
const bcrypt = require('bcrypt'); Also tried with var and multiple ways to write BCrypt, always fails the same way in both files.

Your browser information:

User Agent is: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.146 Safari/537.36.

Challenge: Understand BCrypt Hashes

Link to the challenge:

This looks correct according to the bcrypt docs.

The instructions in the challenge say:

“To begin using BCrypt, add it as a dependency in your project and require it as ‘bcrypt’ in your server.”

What did you do to add it as a dependency in your project?

I did the normal, npm install bcrypt.

The test to see if BCrypt is installed succeeds, so the installation shouldn’t be an issue AFAIK.

Do you have a link to your code you can paste here so we can try it for ourselves?

@bbsmooth, sorry I must be sleeping. Didn’t notice that the sandbox on Repl.it changed for this challenge and was trying to do this on the infosec one.

Just noticed now that was trying to make it available and noticed that it opened another sandbox.

Sorry for wasting your time

No worries. Glad you figured it out.