gpt4 book ai didi

node.js - bcrypt - Windows 10 x64 构建错误

转载 作者:太空宇宙 更新时间:2023-11-03 22:11:49 26 4
gpt4 key购买 nike

我在 Windows 10 x64 上安装 bcrypt 时遇到问题。

我的安装:

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

我已经阅读了如何使用基于node-gyp的bcrypt包。我真的厌倦了与这个问题作斗争。我收到错误:(PS 我尝试使用 v0.8.6)

> 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'

就像您看到一堆警告但根本没有文件一样。我看到了一些类似的问题,但每个1都有不同的配置,所以我决定创建一个新线程。为什么在 Ubuntu 上一切正常,而在 Windows 上却总是出现问题...

讨厌我的公司电脑。

请指点,并致以最诚挚的问候!乌兰

最佳答案

我遇到了同样的问题:windows10 电脑,无法安装 bcrypt。

我通过使用bcryptjs解决了这个问题(不要将它与bcrypt混淆)。

基本上,bcryptjs 与 bcrypt 完成相同的工作,但前者是用纯 js 编写的,没有繁琐的依赖项。唯一的缺点是它比 bcrypt 慢 30%。

对我来说,它立即起作用了。

这是link到 npmjs 网站上的相关页面:

关于node.js - bcrypt - Windows 10 x64 构建错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40130257/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com