当前位置: 首页 > 面试题库 >

编译bcrypt时出错-node.js

濮阳原
2023-03-14
问题内容

我正在尝试npm install使用Windows 7 Ultimate x64 安装bycrpt 。这是我的安装日志:

D:\Dropbox\Projekte\RZ\Finance-Man-GUI\node_modules\bcrypt>node "C:\Program File
s\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node
-gyp.js" rebuild
npm http GET https://registry.npmjs.org/mime/1.2.6
npm http 304 https://registry.npmjs.org/coffee-script
npm http 304 https://registry.npmjs.org/mkdirp
npm http 304 https://registry.npmjs.org/cssom
npm http 304 https://registry.npmjs.org/hooks/0.2.1
npm http 304 https://registry.npmjs.org/mongodb/1.2.8
npm http 304 https://registry.npmjs.org/ms/0.1.0
npm http 304 https://registry.npmjs.org/sliced/0.0.3
npm http 304 https://registry.npmjs.org/muri/0.1.0
npm http 304 https://registry.npmjs.org/mime/1.2.6
npm http GET https://registry.npmjs.org/crc/0.2.0
npm http GET https://registry.npmjs.org/pause/0.0.1
npm http GET https://registry.npmjs.org/bytes/0.1.0
npm http GET https://registry.npmjs.org/formidable/1.0.11
npm http GET https://registry.npmjs.org/qs/0.5.1
npm http GET https://registry.npmjs.org/bson/0.1.5
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppBuild.targets(29
7,5): warning MSB8003: Could not find WindowsSDKDir variable from the registry.
  TargetFrameworkVersion or PlatformToolset may be set to an invalid version nu
mber. [D:\Dropbox\Projekte\RZ\Finance-Man-GUI\node_modules\bcrypt\build\bcrypt_
lib.vcxproj]
  blowfish.cc
  bcrypt.cc
  bcrypt_node.cc
..\src\bcrypt.cc(232): warning C4267: '=' : conversion from 'size_t' to 'unsign
ed char', possible loss of data [D:\Dropbox\Projekte\RZ\Finance-Man-GUI\node_mo
dules\bcrypt\build\bcrypt_lib.vcxproj]
c:\users\timd\.node-gyp\0.8.18\deps\uv\include\ares.h(49): fatal error C1083: C
annot open include file: 'winsock2.h': No such file or directory [D:\Dropbox\Pr
ojekte\RZ\Finance-Man-GUI\node_modules\bcrypt\build\bcrypt_lib.vcxproj]
gyp ERR! build error
gyp ERR! stack Error: `C:\Windows\Microsoft.NET\Framework64\v4.0.30319\msbuild.e
xe` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onExit (C:\Program Files\nodejs\node_modules\
npm\node_modules\node-gyp\lib\build.js:255:23)
gyp ERR! stack     at ChildProcess.EventEmitter.emit (events.js:99:17)
gyp ERR! stack     at Process._handle.onexit (child_process.js:678:10)
gyp ERR! System Windows_NT 6.1.7600
gyp ERR! command "node" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modu
les\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd D:\Dropbox\Projekte\RZ\Finance-Man-GUI\node_modules\bcrypt
gyp ERR! node -v v0.8.18
gyp ERR! node-gyp -v v0.8.2
gyp ERR! not ok
npm ERR! bcrypt@0.7.3 install: `node-gyp rebuild`
npm ERR! `cmd "/c" "node-gyp rebuild"` failed with 1
npm ERR!
npm ERR! Failed at the bcrypt@0.7.3 install script.
npm ERR! This is most likely a problem with the bcrypt package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-gyp rebuild
npm ERR! You can get their info via:
npm ERR!     npm owner ls bcrypt
npm ERR! There is likely additional logging output above.

npm ERR! System Windows_NT 6.1.7600
npm ERR! command "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nod
ejs\\node_modules\\npm\\bin\\npm-cli.js" "install"
npm ERR! cwd D:\Dropbox\Projekte\RZ\Finance-Man-GUI
npm ERR! node -v v0.8.18
npm ERR! npm -v 1.2.2
npm ERR! code ELIFECYCLE
npm http 304 https://registry.npmjs.org/crc/0.2.0
npm http 304 https://registry.npmjs.org/qs/0.5.1
npm http 304 https://registry.npmjs.org/pause/0.0.1
npm http 304 https://registry.npmjs.org/bson/0.1.5
npm http 304 https://registry.npmjs.org/formidable/1.0.11
npm http 304 https://registry.npmjs.org/bytes/0.1.0

> bson@0.1.5 install D:\Dropbox\Projekte\RZ\Finance-Man-GUI\node_modules\mongoos
e\node_modules\mongodb\node_modules\bson
> node install.js || (exit 0)

================================================================================

=                                                                              =

=  Attempting to build bson c++ extension                                      =

=   Windows: no build will be attempted as binaries are prepackaged            =

=   Unix: on failure the package will still install without the C++ extension  =

=                                                                              =

================================================================================

npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR!     D:\Dropbox\Projekte\RZ\Finance-Man-GUI\npm-debug.log
npm ERR! not ok code 0

我已经安装了Python <v2.7和.NET Framework SDK
2.0。我还下载了一个名为win7sdkx64.exe的程序包,我认为这是Visual Studio的sdk。我喜欢我的所有依赖项,Path如下所示:

%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;C:\Program Files\nodejs\;E:\Program Files\Java\jdk1.6.0_38\bin;C:\Program Files (x86)\Heroku\bin;C:\Program Files (x86)\ruby-1.9.2\bin;C:\Program Files (x86)\git\bin;C:\Program Files (x86)\git\cmd;E:\Program Files (x86)\Heroku\bin;C:\mongodb-win32-x86_64-2.2.2\bin;E:\xampp\mysql\bin;E:\xampp\apache\bin;E:\Python27;C:\Program Files (x86)\Microsoft Visual Studio 8\VC\vcpackages;C:\Program Files\Microsoft Windows Performance Toolkit\;E:\Program Files (x86)\openssl-0.9.8k_X64\bin

但我仍然遇到这些错误。我接下来可以尝试什么?完全安装Visual Studio吗?


问题答案:

放弃bcrypt模块,改用本机JavaScript库。bcrypt-
nodejs
不需要编译,并且提供与已编译的bcrypt几乎相同的功能。



 类似资料:
  • 包规范成功地编译了消息“SPBomPackage Compiled”,但在编译包体时,我有两个错误,它们是“错误(17,6):PL/SQL:忽略语句”和“错误(17,17):PLS-00302:必须声明组件‘ITEM\u ID’”,包规范,包体,我使用的三个表格,这个软件包将使用,粘贴和格式很好,您可以在这个链接查看:

  • 我正试着反编译MCP9.40到《我的世界》1.12。但是当我运行反编译。bat时,它会返回以下错误。 https://hastebin.com/itefigucaz.bash 我环顾四周,发现可能是反编译程序的RAM用完了,所以我编辑了mcp.cfg文件,并从这里修改了一行。 对此。 但也会产生同样的错误。有什么想法吗?

  • 问题内容: 我无法在计算机上使用进行安装,因为遇到以下错误。我一直在排除此问题,但运气不佳。您可以建议任何步骤来诊断或解决问题,以便我可以成功运行吗? 问题答案: 简单的解决方案是从“ bcrypt” npm模块切换到或。它是完全相同的API,但使用纯JS,因此无需处理本机附加组件。 然后将您的调用更改为“ bcryptjs”,但是所有其他代码都可以保持不变。 从长远来看,我怀疑目前bcrypt可

  • * *我正在使用JSP、JavaServlet和Hibernate开发一个电子商务应用程序。执行此代码时出现以下错误。我得到了这个错误需要帮助调试它**

  • 我是的新手,我正在尝试使用在eclipse上构建一个应用程序,我遵循了一个教程,并且做了完全相同的操作,该应用程序非常简单,当我试图编译它时,我得到了一堆我甚至不理解的错误: 你能告诉我我错过了什么吗。