# 20- Setting Up the Node Backend

**URL:** <https://forum.codewithmosh.com/t/20-setting-up-the-node-backend/2682>\
**Category:** React\
**Created:** [February 15, 2021, 3:40pm UTC](https://forum.codewithmosh.com/t/20-setting-up-the-node-backend/2682 "2021-02-15T15:40:15Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![jufriazzq](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jufriazzq](https://forum.codewithmosh.com/u/jufriazzq)\
**Post date:** [February 15, 2021, 3:40pm UTC](https://forum.codewithmosh.com/t/20-setting-up-the-node-backend/2682/1 "2021-02-15T15:40:15Z")

</div>

> **[20- Setting Up the Node Backend](https://codewithmosh.com/courses/mastering-react/lectures/5867613)**
>
> Learn to build fast, interactive apps with React, the right way!

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

 ![image](https://us1.discourse-cdn.com/flex020/uploads/codewithmosh/original/1X/2b73d910bdafd783b35a71a63648f13e9cd808e8.png)

---

<div class="post-metadata">

**Author:** ![nithinkjoy](https://avatars.discourse-cdn.com/v4/letter/n/f19dbf/32.png) [@nithinkjoy](https://forum.codewithmosh.com/u/nithinkjoy)\
**Post date:** [February 16, 2021, 3:21pm UTC](https://forum.codewithmosh.com/t/20-setting-up-the-node-backend/2682/2 "2021-02-16T15:21:58Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![jzironman](https://avatars.discourse-cdn.com/v4/letter/j/54ee81/32.png) [@jzironman](https://forum.codewithmosh.com/u/jzironman)\
**Post date:** [March 25, 2021, 10:03am UTC](https://forum.codewithmosh.com/t/20-setting-up-the-node-backend/2682/3 "2021-03-25T10:03:41Z")

</div>

Have you already fixed this issue?

---

<div class="post-metadata">

**Author:** ![jufriazzq](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jufriazzq](https://forum.codewithmosh.com/u/jufriazzq)\
**Post date:** [March 26, 2021, 5:00am UTC](https://forum.codewithmosh.com/t/20-setting-up-the-node-backend/2682/4 "2021-03-26T05:00:31Z")

</div>

npm uninstall bcrypt first the install npm i bcryptjs

---

<div class="post-metadata">

**Author:** ![shaddyjr](https://avatars.discourse-cdn.com/v4/letter/s/e9c0ed/32.png) [@shaddyjr](https://forum.codewithmosh.com/u/shaddyjr)\
**Post date:** [April 25, 2021, 9:30pm UTC](https://forum.codewithmosh.com/t/20-setting-up-the-node-backend/2682/5 "2021-04-25T21:30:05Z")

</div>

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");`

---

<div class="post-metadata">

**Author:** ![UniqueNospaceShort](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.codewithmosh.com/uniquenospaceshort/32/1814_2.png) [@UniqueNospaceShort](https://forum.codewithmosh.com/u/UniqueNospaceShort)\
**Post date:** [June 23, 2021, 8:59am UTC](https://forum.codewithmosh.com/t/20-setting-up-the-node-backend/2682/6 "2021-06-23T08:59:14Z")

</div>

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:

```auto
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](https://us1.discourse-cdn.com/flex020/uploads/codewithmosh/original/2X/0/063d4cf54d12640f7b79fff695e32d9e52f7b20a.png)

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](https://we.tl/t-dTNuZ3wJcO)

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.

---

<div class="post-metadata">

**Author:** ![hinlocaesar](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.codewithmosh.com/hinlocaesar/32/2554_2.png) [@hinlocaesar](https://forum.codewithmosh.com/u/hinlocaesar)\
**Post date:** [November 10, 2021, 1:13pm UTC](https://forum.codewithmosh.com/t/20-setting-up-the-node-backend/2682/7 "2021-11-10T13:13:48Z")

</div>

@UniqueNospaceShort How did you fix this? Huhuhuh

---

<div class="post-metadata">

**Author:** ![Augustine\_Awuori](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.codewithmosh.com/augustine_awuori/32/873_2.png) [@Augustine\_Awuori](https://forum.codewithmosh.com/u/Augustine_Awuori)\
**Post date:** [November 21, 2021, 1:35pm UTC](https://forum.codewithmosh.com/t/20-setting-up-the-node-backend/2682/8 "2021-11-21T13:35:12Z")

</div>

> [@nithinkjoy](#):
>
> npm i bcrypt@latest

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