Cannot find module 'bcrypt'

前端 未结 30 3275
轻奢々
轻奢々 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:38

    Solution 1: lengthy method is : Install all dependencies first.

    npm install -g windows-build-tools, npm install -g node-gyp

    then, install bcrypt : npm install bcrypt

    Solution 2: easy method. No dependencies installation required.

    npm install bcryptjs

    ...You might have installed bcrypt but it seems like the installation was not successful for some reason. check the package.json file. If you cannot find bcrypt, the installtion was unsuccessful. You have to install again.

    As everyone explained, it because of lack dependencies that your installation was unsuccessful. You can checkout the required dependencies in the link: https://www.npmjs.com/package/bcrypt

    Note: To use bcrypt: var bcrypt = require('bcrypt'); .....

    to use bcryptjs. var bcrypt = require('bcryptjs');

    for reference: https://www.npmjs.com/package/bcrypt https://www.npmjs.com/package/bcryptjs

提交回复
热议问题