20- Setting Up the Node Backend

failed on installing the required module,(npm i ) not working

first try using npm i bcrypt@latest
then try npm i

3 Likes

Have you already fixed this issue?

npm uninstall bcrypt first the install npm i bcryptjs

  1. Uninstall bcrypt using npm uninstall bcrypt

  2. Install bcryptjs using npm i bcryptjs

  3. Update the references in the two files (auth.js and users.js) importing the “old” version from
    const bcrypt = require("bcrypt");
    to
    const bcrypt = require("bcryptjs");

Good morning,
I am new to the forum and I am following the React tutorial where I had to setup that Vidly Node Backend and ran in the same kind of problems.
I did lookup for solutions and eventually ended up on our usual StackOverflow.
There I read about commands to type. Some did not seem to work.
In the end I did install bcrypt 5.0.0 as one of the proposition told and it seems to have gone further.

I can npm start. When I went to MongoDB Compass this morning I see a vidly DB.
But there are messages in the npm start that make me wonder if there is something going wrong or would I maybe ignore thoses messages.

Could anyone tell me ?
I put the output bellow:

PS D:\Partages\Scripts\web\reactProj\MH-React - Full\vidly-api-node> npm start

> vidly@1.0.0 start D:\Partages\Scripts\web\reactProj\MH-React - Full\vidly-api-node
> node index.js

(node:13360) Warning: Accessing non-existent property 'padLevels' of module exports inside circular dependency
(Use `node --trace-warnings ...` to show where the warning was created)
(node:13360) DeprecationWarning: current URL string parser is deprecated, and will be removed in a future version. To use the new parser, pass option { useNewUrlParser: true } to MongoClient.connect.
(node:13360) [MONGODB DRIVER] Warning: Current Server Discovery and Monitoring engine is deprecated, and will be removed in a future version. To use the new Server Discover and Monitoring engine, pass option { useUnifiedTopology: true } to the MongoClient constructor.
info: Listening on port 3900...
(node:13360) DeprecationWarning: collection.ensureIndex is deprecated. Use createIndexes instead.
info: Connected to mongodb://localhost/vidly...

Kind Regards.

P.S.
I add a screenshot of what I see in compass.
image

If there is a users “table”, shouldn’t I also see movies or other tables?
If so, wouldn’t it indicate something did not go right?

Further Edit:
I started over and I am following instructions from the GitHub repo combined with what is here.
So.

Downloaded the files
uninstalled bcrypt
npm install bcrypt@lastest → which was 5.0.1
npm i → seems to have went fine

node seed.js → seems to be OK

npm test → many tests fail

I installed jest-html-reporter to generate a test report.
It doesn’t seem I am able to attach files here so I provide link.
Expires in 7 days a.k.a. on 2021/06/30

Test Report @WeTransfer

Update: Some of the tests were failing because unlike what is in the course, there is a setting to disable authentication that is already disabled. Upon reenabling them, there are still failed test but way less. The link to report have been updated accordingly.

@UniqueNospaceShort How did you fix this? Huhuhuh

This really works. Thanks you have just saved me after some days of strugge.

1 Like