簡體   English   中英

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

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

我正在通過HAPI js教程Authentication部分( http://hapijs.com/tutorials/auth?lang=zh_CN ),該部分需要“ bcrypt”。 所以我做了“ npm install bcrypt --save”。 但這給了像php這樣的node-gyp錯誤。 因此,我按照此處給出的說明進行操作: https : //github.com/nodejs/node-gyp#installation

我什至做了:npm install --global --production Windows-build-tools

但是現在它拋出了錯誤:

“ CL.exe”退出,代碼為-1073741511

我已經安裝了他們要求的所有內容,但不允許安裝bcrypt。 我該怎么辦?

由於簡單的教程練習使我花了2天的時間才解決所有問題。 為什么在您的教程中使用此類依賴驅動程序包?

這是我正在執行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

錯誤代碼-1073741511轉換為0xC0000139,顯然是“找不到DLL”。

這使我認為您的C ++構建工具鏈出了問題,這是構建bcrypt庫的本機位所必需的。

我知道這沒有太大幫助,但是可以在我的機器上使用:

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>

至於你的問題

為什么在您的教程中使用此類依賴驅動程序包?

-這只是Node.js / NPM世界的方式。 許多做一件事的小包裝(據說做得很好,盡管並非總是如此)...

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM