简体   繁体   English

bcrypt-Windows 10 x64构建错误

[英]bcrypt - windows 10 x64 build error

I have issue with bcrypt installation on windows 10 x64. 我在Windows 10 x64上安装bcrypt时遇到问题。

My installs: 我的安装:

node = 6.31
node-gyp = 3.4.0
npm = 3.10.3
python = 2.7.0
VSCommunity 2015
windows build tools

I have readed how to, with bcrypt package, based on node-gyp. 我已经阅读了如何使用bcrypt包基于node-gyp。 I am really tired of fighting with this issue. 我真的厌倦了与这个问题作斗争。 I got error: (PS I tried with v0.8.6) 我收到错误消息:(我尝试使用v0.8.6的PS)

> bcrypt@0.8.6 install C:\Users\pi15463\www\BaaS\node_modules\bcrypt
> node-gyp rebuild


C:\Users\pi15463\www\BaaS\node_modules\bcrypt>if not defined npm_config_node_gyp                   (node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_mo                  dules\node-gyp\bin\node-gyp.js" rebuild )  else (node "" rebuild )
Building the projects in this solution one at a time. To enable parallel build,                   please add the "/m" switch.
  blowfish.cc
  bcrypt.cc
  bcrypt_node.cc
..\src\bcrypt.cc(232): warning C4267: '=': conversion from 'size_t' to 'unsigned                   char', possible loss of data [C:\Users\pi15463\www\BaaS\node_modules\bcrypt\bui                  ld\bcrypt_lib.vcxproj]
..\src\bcrypt_node.cc(76): warning C4244: 'argument': conversion from 'ssize_t'                   to 'unsigned char', possible loss of data [C:\Users\pi15463\www\BaaS\node_module                  s\bcrypt\build\bcrypt_lib.vcxproj]
..\src\bcrypt_node.cc(229): warning C4267: 'initializing': conversion from 'size                  _t' to 'int', possible loss of data [C:\Users\pi15463\www\BaaS\node_modules\bcry                  pt\build\bcrypt_lib.vcxproj]
..\src\bcrypt_node.cc(230): warning C4267: 'initializing': conversion from 'size                  _t' to 'int', possible loss of data [C:\Users\pi15463\www\BaaS\node_modules\bcry                  pt\build\bcrypt_lib.vcxproj]
  win_delay_load_hook.c
C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\src\win_delay_loa                  d_hook.c(34): error C2373: '__pfnDliNotifyHook2': redefinition; different type m                  odifiers [C:\Users\pi15463\www\BaaS\node_modules\bcrypt\build\bcrypt_lib.vcxproj                  ]
  C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\delayimp.h(134)                  : note: see declaration of '__pfnDliNotifyHook2'

Like you see a bounch of warns and no files at all. 就像您看到一阵警告,根本没有文件。 I saw some similar problems, but every1 has different configuration, so I decided to create a new thread. 我看到了一些类似的问题,但是every1具有不同的配置,因此我决定创建一个新线程。 Why on Ubuntu everything works ok, and on windows always are problems... 为什么在Ubuntu上一切正常,而在Windows上总是有问题...

Hate my corporate pc. 讨厌我的公司电脑。

Please for hints, and best regards! 请提供提示和最诚挚的问候! Uland 乌兰

I had the same problem: windows10 pc and no way to get bcrypt installed. 我遇到了同样的问题:Windows10 pc,无法安装bcrypt。

I solved this by using bcryptjs (do not confuse it with bcrypt). 我通过使用bcryptjs解决了这一问题(不要将其与bcrypt混淆)。

Basically bcryptjs does the same job as bcrypt but the former is written in pure js and has no cumbersome dependencies. 基本上,bcryptjs的工作与bcrypt相同,但是前者是用纯js编写的,没有繁琐的依赖关系。 The only downside is that it is 30% slower than bcrypt. 唯一的缺点是它比bcrypt慢30%。

For me it worked right away. 对我来说,它立即起作用。

here is the link to the relevant page on the npmjs website: 这是npmjs网站上相关页面的链接

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM