Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting error Error: Cannot find module 'bcrypt' #36

Open
shailesh-vanaliya opened this issue Jul 19, 2021 · 4 comments
Open

Getting error Error: Cannot find module 'bcrypt' #36

shailesh-vanaliya opened this issue Jul 19, 2021 · 4 comments

Comments

@shailesh-vanaliya
Copy link

2021-07-19T09_57_53_633Z-debug.log

I have checked package json file but bcrypt package already available

Error: Cannot find module 'bcrypt'
Require stack:

  • E:\angular\kanhashoft\Node-With-Mongo\test\myproject\controllers\AuthController.js
  • E:\angular\kanhashoft\Node-With-Mongo\test\myproject\routes\auth.js
  • E:\angular\kanhashoft\Node-With-Mongo\test\myproject\routes\api.js
  • E:\angular\kanhashoft\Node-With-Mongo\test\myproject\app.js
  • E:\angular\kanhashoft\Node-With-Mongo\test\myproject\bin\www
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:902:15)
    at Function.Module._load (internal/modules/cjs/loader.js:746:27)
    at Module.require (internal/modules/cjs/loader.js:974:19)
    at require (internal/modules/cjs/helpers.js:92:18)
    at Object. (E:\angular\kanhashoft\Node-With-Mongo\test\myproject\controllers\AuthController.js:7:16)
    at Module._compile (internal/modules/cjs/loader.js:1085:14)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
    at Module.load (internal/modules/cjs/loader.js:950:32)
    at Function.Module._load (internal/modules/cjs/loader.js:790:14)
    at Module.require (internal/modules/cjs/loader.js:974:19)
    at require (internal/modules/cjs/helpers.js:92:18)
    at Object. (E:\angular\kanhashoft\Node-With-Mongo\test\myproject\routes\auth.js:2:24)
    at Module._compile (internal/modules/cjs/loader.js:1085:14)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
    at Module.load (internal/modules/cjs/loader.js:950:32)
    at Function.Module._load (internal/modules/cjs/loader.js:790:14) {
    code: 'MODULE_NOT_FOUND',
    requireStack: [
    'E:\angular\kanhashoft\Node-With-Mongo\test\myproject\controllers\AuthController.js',
    'E:\angular\kanhashoft\Node-With-Mongo\test\myproject\routes\auth.js',
    'E:\angular\kanhashoft\Node-With-Mongo\test\myproject\routes\api.js',
    'E:\angular\kanhashoft\Node-With-Mongo\test\myproject\app.js',
    'E:\angular\kanhashoft\Node-With-Mongo\test\myproject\bin\www'
    ]
    }
@shailesh-vanaliya
Copy link
Author

node -v
v14.17.2

Mongodb : 5.0.0

@mrfy
Copy link

mrfy commented Aug 5, 2021

First:
npm uninstall bcrypt

second
npm install bcrypt

It will install newest bcrypt package.

@yugkhokhar
Copy link

You can even use bcryptjs

@mdmuhtasimfuadfahim
Copy link

mdmuhtasimfuadfahim commented May 7, 2023

The below commands may solve your problem:

npm install node-gyp -g
npm install bcrypt -g

npm install bcrypt --save

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants