Cannot find module 'bcrypt'

前端 未结 30 2998
轻奢々
轻奢々 2020-12-24 01:54

I am getting error Cannot find module \'bcrypt\' in nodejs application

I have tried to install it using npm install bcrypt but still gett

相关标签:
30条回答
  • 2020-12-24 02:27

    You have to install bcryptjs. Use npm install bcryptjs --save It worked for me when I was stuck here.

    0 讨论(0)
  • 2020-12-24 02:28

    The solution for me was to npm rebuild.

    0 讨论(0)
  • 2020-12-24 02:29

    This worked for me.

    1) Delete any bcrypt folder in nodemodules folder, folder may have been created due to your repeated tries. (C:\Program Files\nodejs\node_modules\npm\node_modules)

    2) run this code npm install --save bcryptjs e.g -

    C:\Projects\loginapp>npm install --save bcryptjs 
    
    0 讨论(0)
  • 2020-12-24 02:29

    I'm using bcrypt with typescript

    npm i --save @types/bcryptjs
    

    Helped me solve the error above.

    0 讨论(0)
  • 2020-12-24 02:31

    If none of these examples didn't work, you should try to downgrade Node version installed:

    E.g from Node version 10 to version 9

    npm install node@<version of node>
    
    0 讨论(0)
  • 2020-12-24 02:33

    It should be npm install bcrypt --save. Works for me!

    And, if you have others issues after install it, you can check your packages with npm-check.

    0 讨论(0)
提交回复
热议问题