How to fix npm install in Mastering React course vidly-api-node?

I am following along the course of Mastering React, currently i am having problem with npm install, when i clone ‘vidly-api-node’ from gihtub. it logging a bunch of errors related to gyp and bcrypt_lib? Can anyone explain why i am having this problem and how to fix?

Finally i found out the solution after long search on google, if anyone encounters this kind of issue in the future here are the commands to run:

sudo npm cache clean -f
sudo npm install -g n
sudo n 8.4.0

Im also faceng the same problem but the given solution did not work for me (npm install -g n )

there is another solution which worked for me , that is to delete the existing bcrypt module and installing new one

thanks

Hi.
Interesting.
I actually fixed these errors another way.
That said this n package is platform specific and is not a valid for Windows.

PS D:\Users\User\Desktop\vidly-api-node-master> npm install -g n
npm ERR! code EBADPLATFORM
npm ERR! notsup Unsupported platform for n@7.3.0: wanted {"os":"!win32","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm ERR! notsup Valid OS:    !win32
npm ERR! notsup Valid Arch:  any
npm ERR! notsup Actual OS:   win32
npm ERR! notsup Actual Arch: x64

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\User\AppData\Roaming\npm-cache\_logs\2021-06-24T11_11_16_087Z-debug.log

As for why it happens, I have little to no clue. gyp is a compiler for native addons for Node.js.
Seems bcrypt installation involves platform specific compilation. They probably have a common code base and did not compile platform specific packages. That just guessing. All I know from node and npm is their general purpose and a few commands I ever typed to test or start the servers I deal with and manage packages.

Kind Regards.