简体   繁体   English

“ CL.exe”以代码-1073741511退出,用于“ npm install bcrypt --save”

[英]“CL.exe” exited with code -1073741511, for 'npm install bcrypt --save"

I am going through the HAPI js tutorial Authentication section( http://hapijs.com/tutorials/auth?lang=en_US ), which requires the "bcrypt". 我正在通过HAPI js教程Authentication部分( http://hapijs.com/tutorials/auth?lang=zh_CN ),该部分需要“ bcrypt”。 So I did "npm install bcrypt --save". 所以我做了“ npm install bcrypt --save”。 But this is giving node-gyp errors like php was missing. 但这给了像php这样的node-gyp错误。 So I followed the instructions given here : https://github.com/nodejs/node-gyp#installation 因此,我按照此处给出的说明进行操作: https : //github.com/nodejs/node-gyp#installation

I even did :npm install --global --production windows-build-tools 我什至做了:npm install --global --production Windows-build-tools

But now it's throwing error : 但是现在它抛出了错误:

"CL.exe" exited with code -1073741511 “ CL.exe”退出,代码为-1073741511

I have installed everything they asked for yet it's not allowing to install bcrypt. 我已经安装了他们要求的所有内容,但不允许安装bcrypt。 What do I do? 我该怎么办?

As simple tutorial exercise has taken me 2 days of research without any solution. 由于简单的教程练习使我花了2天的时间才解决所有问题。 Why use such dependency driven packages in your tutorial? 为什么在您的教程中使用此类依赖驱动程序包?

This is the actual console log I am getting on doing npm install bcrypt : 这是我正在执行npm install bcrypt的实际控制台日志:

    m WARN package.json personal_assistant@1.0.0 No README data

bcrypt@0.8.7 install D:\learn\personal_assistant\server\node_modules\bcrypt
node-gyp rebuild


\learn\personal_assistant\server\node_modules\bcrypt>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\
\node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (node "" rebuild )
ilding the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
\Program Files\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppCommon.targets(356,5): error MSB6006: "CL.exe" exited with code -1073741511. [D:\learn\personal_
sistant\server\node_modules\bcrypt\build\bcrypt_lib.vcxproj]
p ERR! build error
p ERR! stack Error: `C:\Program Files\MSBuild\14.0\bin\msbuild.exe` failed with exit code: 1
p ERR! stack     at ChildProcess.onExit (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\build.js:276:23)
p ERR! stack     at emitTwo (events.js:87:13)
p ERR! stack     at ChildProcess.emit (events.js:172:7)
p ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
p ERR! System Windows_NT 6.1.7600
p ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
p ERR! cwd D:\learn\personal_assistant\server\node_modules\bcrypt
p ERR! node -v v4.5.0
p ERR! node-gyp -v v3.4.0
p ERR! not ok
m ERR! Windows_NT 6.1.7600
m ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "bcrypt" "--save"
m ERR! node v4.5.0
m ERR! npm  v2.15.9
m ERR! code ELIFECYCLE

m ERR! bcrypt@0.8.7 install: `node-gyp rebuild`
m ERR! Exit status 1
m ERR!
m ERR! Failed at the bcrypt@0.8.7 install script 'node-gyp rebuild'.
m ERR! This is most likely a problem with the bcrypt package,
m ERR! not with npm itself.
m ERR! Tell the author that this fails on your system:
m ERR!     node-gyp rebuild
m ERR! You can get information on how to open an issue for this project with:
m ERR!     npm bugs bcrypt
m ERR! Or if that isn't available, you can get their info via:
m ERR!
m ERR!     npm owner ls bcrypt
m ERR! There is likely additional logging output above.

m ERR! Please include the following file with any support request:
m ERR!     D:\learn\personal_assistant\server\npm-debug.log

Error code -1073741511 translates to 0xC0000139, which is apparently "DLL not found". 错误代码-1073741511转换为0xC0000139,显然是“找不到DLL”。

That leads me to think there's something wrong with your C++ build toolchain, which is required to build the native bits of the bcrypt library. 这使我认为您的C ++构建工具链出了问题,这是构建bcrypt库的本机位所必需的。

I know this doesn't help too much, but it Works On My Machine: 我知道这没有太大帮助,但是可以在我的机器上使用:

C:\Users\X\Desktop\xx>npm i --save bcrypt
npm info it worked if it ends with ok
npm info using npm@3.8.6
npm info using node@v6.1.0
npm info ok
npm info it worked if it ends with ok
npm info using npm@3.5.0
npm info using node@v6.1.0

> bcrypt@0.8.7 install C:\Users\X\Desktop\xx\node_modules\bcrypt
> node-gyp rebuild

C:\Users\X\Desktop\xx\node_modules\bcrypt>if not defined npm_config_node_gyp (node "C:\Users\X\AppData\Roaming\npm\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (node  rebuild )
gyp info it worked if it ends with ok
gyp info using node-gyp@3.0.3
gyp info using node@6.1.0 | win32 | x64
gyp http GET https://nodejs.org/download/release/v6.1.0/node-v6.1.0-headers.tar.gz
gyp http 200 https://nodejs.org/download/release/v6.1.0/node-v6.1.0-headers.tar.gz
gyp http GET https://nodejs.org/download/release/v6.1.0/SHASUMS256.txt
gyp http GET https://nodejs.org/download/release/v6.1.0/win-x86/node.lib
gyp http GET https://nodejs.org/download/release/v6.1.0/win-x64/node.lib
gyp http 200 https://nodejs.org/download/release/v6.1.0/win-x86/node.lib
gyp http 200 https://nodejs.org/download/release/v6.1.0/SHASUMS256.txt
gyp http 200 https://nodejs.org/download/release/v6.1.0/win-x64/node.lib
gyp info spawn python
gyp info spawn args [ 'C:\\Users\\X\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp\\gyp\\gyp_main.py',
gyp info spawn args   'binding.gyp',
gyp info spawn args   '-f',
gyp info spawn args   'msvs',
gyp info spawn args   '-G',
gyp info spawn args   'msvs_version=auto',
gyp info spawn args   '-I',
gyp info spawn args   'C:\\Users\\X\\Desktop\\xx\\node_modules\\bcrypt\\build\\config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   'C:\\Users\\X\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp\\addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   'C:\\Users\\X\\.node-gyp\\6.1.0\\include\\node\\common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=C:\\Users\\X\\.node-gyp\\6.1.0',
gyp info spawn args   '-Dnode_gyp_dir=C:\\Users\\X\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp',
gyp info spawn args   '-Dnode_lib_file=node.lib',
gyp info spawn args   '-Dmodule_root_dir=C:\\Users\\X\\Desktop\\xx\\node_modules\\bcrypt',
gyp info spawn args   '--depth=.',
gyp info spawn args   '--no-parallel',
gyp info spawn args   '--generator-output',
gyp info spawn args   'C:\\Users\\X\\Desktop\\xx\\node_modules\\bcrypt\\build',
gyp info spawn args   '-Goutput_dir=.' ]
gyp info spawn C:\Program Files (x86)\MSBuild\12.0\bin\msbuild.exe
gyp info spawn args [ 'build/binding.sln',
gyp info spawn args   '/clp:Verbosity=minimal',
gyp info spawn args   '/nologo',
gyp info spawn args   '/p:Configuration=Release;Platform=x64' ]
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\X\Desktop\xx\node_modules\bcrypt\build\bcrypt_lib.vcxproj]
..\src\bcrypt_node.cc(76): warning C4244: 'argument' : conversion from 'ssize_t' to 'unsigned char', possible loss of data [C:\Users\X\Desktop\xx\node_modules\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\X\Desktop\xx\node_modules\bcrypt\build\bcrypt_lib.vcxpr oj]
..\src\bcrypt_node.cc(230): warning C4267: 'initializing' : conversion from 'size_t' to 'int', possible loss of data [C:\Users\X\Desktop\xx\node_modules\bcrypt\build\bcrypt_lib.vcxpr oj]
  win_delay_load_hook.c
     Creating library C:\Users\X\Desktop\xx\node_modules\bcrypt\build\Release\bcrypt_lib.lib and object C:\Users\X\Desktop\xx\node_modules\bcrypt\build\Release\bcrypt_lib.exp
  Generating code
  Finished generating code
  bcrypt_lib.vcxproj -> C:\Users\X\Desktop\xx\node_modules\bcrypt\build\Release\\bcrypt_lib.node
gyp info ok
npm info lifecycle bindings@1.2.1~postinstall: bindings@1.2.1
npm info lifecycle nan@2.3.5~postinstall: nan@2.3.5
npm info lifecycle bcrypt@0.8.7~postinstall: bcrypt@0.8.7
npm WARN saveError ENOENT: no such file or directory, open 'C:\Users\X\Desktop\xx\package.json'
C:\Users\X\Desktop\xx
└─┬ bcrypt@0.8.7
  ├── bindings@1.2.1
  └── nan@2.3.5

npm info ok

C:\Users\X\Desktop\xx>

As for your question, 至于你的问题

Why use such dependency driven packages in your tutorial? 为什么在您的教程中使用此类依赖驱动程序包?

-- that's just the way of the Node.js/NPM world. -这只是Node.js / NPM世界的方式。 Lots of small packages that do one thing (and supposedly do it well, though that's not always the case)... 许多做一件事的小包装(据说做得很好,尽管并非总是如此)...

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

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