javascriptnode.jsnpmbcrypt

bcrypt npm install error - Error: Cannot find module node-pre-gyp\bin\node-pre-gyp


I'm on Windows 10 (version 10.0.17763 build 17763). I'm trying to install Bcrypt with Nodejs Express server using NPM. I've updated the latest Nodejs version (v12.16.3). Whether I install the latest version of Bcrypt or an earlier version, I'm always getting the same error:

enter image description here

I'm not sure why it's looking for node-pre-gyp\bin\node-pre-gyp in the directoy C:\Users\hazzaldo\Desktop\web-dev-udemy-course\. There's no such directory there!! This is just a folder to store my course files.

Also I'm not sure why this is happening:

-Security\store-confidential-data-web-app\node_modules\.bin\' is not recognized as an internal or external command,
operable program or batch file

I've looked in other forums for such error, but no solution helped me. Some are old forums asking to install deprecated modules.


Solution

  • Ok, after two days of pulling my hair out, trying solutions out and not getting anywhere, I finally found a reddit post with someone having exactly the same issue as me: https://www.reddit.com/r/node/comments/gahkjl/npm_drives_me_crazy_for_months_looks_for_bin/

    It's because I used the & character in my folder name. I guess for some reason it throws npm off. Removing this character from my folder name resolved it.