Error installing bcrypt with npm

后端 未结 17 2295
别那么骄傲
别那么骄傲 2020-11-27 14:20

I\'m unable to install bcrypt using npm on my machine because I encounter the following errors. I have been troubleshooting the issue without much luck. Can you

17条回答
  •  醉话见心
    2020-11-27 14:47

    The accepted solution works but bcryptjs is slower than python and c++ version.

    If you still want bcrypt insted of bcryptjs working solution are command below, but they can also have problem.

    ✔️ npm install -g node-gyp
    ❌ npm install --g --production windows-build-tools
    

    In Windows the second command will try to install visual studio along with python and hence the problem arises. because we why would we want to install Visual studio and it take a lot of time. and it also hinders the installation of python. And if you forget to run those command as Administrator then they will get installed at C:\Users\User.windows-build-tools which further will not work because node will search for python in C:\ or C:\Program Files\ . Hence this commands in some case increase your complications.

    So the best idea for you is to ✔️install python manually for All Users And It is not necessary to add python to environment path. And run only the first command i.e

    ✔️ npm install -g node-gyp
    

    Now you are ready to install bcrypt

    npm install bcrypt
    

提交回复
热议问题