2017-01-27 16 views
2

にbcryptのを「NPMインストール」する方法今、私が使用していた私は、NPMバージョン4.1.2と一緒のNode.jsのv6.9.1をインストールしていると私はすでにのWindows 7

いくつかのプロジェクトのために、この組み合わせを使用しましたbcrypt NPMの私のプロジェクトでパッケージが、インストールは無残

npm install bcrypt --save 

私も、これは私が

取得エラーで無駄

に、管理者priviledgesでこのコマンドを実行しようとしたが失敗しました

> [email protected] install C:\Users\ttheiner\NodeProjects\authtest\node_modules\bcry 
pt 
> node-pre-gyp install --fallback-to-build 

node-pre-gyp ERR! Tried to download(404): https://github.com/kelektiv/node.bcryp 
t.js/releases/download/v1.0.2/bcrypt_lib-v1.0.2-node-v48-win32-x64.tar.gz 
node-pre-gyp ERR! Pre-built binaries not found for [email protected] and [email protected] (
node-v48 ABI) (falling back to source compile with node-gyp) 

C:\Users\ttheiner\NodeProjects\authtest\node_modules\bcrypt>if not defined npm_c 
onfig_node_gyp (node "C:\Users\ttheiner\AppData\Roaming\npm\node_modules\npm\bin 
\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" clean) else (node 
"" clean) 

C:\Users\ttheiner\NodeProjects\authtest\node_modules\bcrypt>if not defined npm_c 
onfig_node_gyp (node "C:\Users\ttheiner\AppData\Roaming\npm\node_modules\npm\bin 
\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" configure --fallback 
-to-build --module=C:\Users\ttheiner\NodeProjects\authtest\node_modules\bcrypt\l 
ib\binding\bcrypt_lib.node --module_name=bcrypt_lib --module_path=C:\Users\tthei 
ner\NodeProjects\authtest\node_modules\bcrypt\lib\binding) else (node "" confi 
gure --fallback-to-build --module=C:\Users\ttheiner\NodeProjects\authtest\node_m 
odules\bcrypt\lib\binding\bcrypt_lib.node --module_name=bcrypt_lib --module_path 
=C:\Users\ttheiner\NodeProjects\authtest\node_modules\bcrypt\lib\binding) 
gyp ERR! configure error 
gyp ERR! stack Error: Can't find Python executable "python", you can set the PYT 
HON env variable. 
gyp ERR! stack  at Object.failNoPython (C:\Users\ttheiner\AppData\Roaming\npm 
\node_modules\npm\node_modules\node-gyp\lib\configure.js:454:19) 
gyp ERR! stack  at Object.<anonymous> (C:\Users\ttheiner\AppData\Roaming\npm\ 
node_modules\npm\node_modules\node-gyp\lib\configure.js:480:16) 
gyp ERR! stack  at C:\Users\ttheiner\AppData\Roaming\npm\node_modules\npm\nod 
e_modules\graceful-fs\polyfills.js:284:29 
gyp ERR! stack  at FSReqWrap.oncomplete (fs.js:123:15) 
gyp ERR! System Windows_NT 6.1.7601 
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\ttheiner\\App 
Data\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" 
"configure" "--fallback-to-build" "--module=C:\\Users\\ttheiner\\NodeProjects\\ 
authtest\\node_modules\\bcrypt\\lib\\binding\\bcrypt_lib.node" "--module_name=bc 
rypt_lib" "--module_path=C:\\Users\\ttheiner\\NodeProjects\\authtest\\node_modul 
es\\bcrypt\\lib\\binding" 
gyp ERR! cwd C:\Users\ttheiner\NodeProjects\authtest\node_modules\bcrypt 
gyp ERR! node -v v6.9.1 
gyp ERR! node-gyp -v v3.5.0 
gyp ERR! not ok 
node-pre-gyp ERR! build error 
node-pre-gyp ERR! stack Error: Failed to execute 'node-gyp.cmd configure --fallb 
ack-to-build --module=C:\Users\ttheiner\NodeProjects\authtest\node_modules\bcryp 
t\lib\binding\bcrypt_lib.node --module_name=bcrypt_lib --module_path=C:\Users\tt 
heiner\NodeProjects\authtest\node_modules\bcrypt\lib\binding' (1) 
node-pre-gyp ERR! stack  at ChildProcess.<anonymous> (C:\Users\ttheiner\NodeP 
rojects\authtest\node_modules\node-pre-gyp\lib\util\compile.js:83:29) 
node-pre-gyp ERR! stack  at emitTwo (events.js:106:13) 
node-pre-gyp ERR! stack  at ChildProcess.emit (events.js:191:7) 
node-pre-gyp ERR! stack  at maybeClose (internal/child_process.js:877:16) 
node-pre-gyp ERR! stack  at Process.ChildProcess._handle.onexit (internal/chi 
ld_process.js:226:5) 
node-pre-gyp ERR! System Windows_NT 6.1.7601 
node-pre-gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\tthe 
iner\\NodeProjects\\authtest\\node_modules\\node-pre-gyp\\bin\\node-pre-gyp" "in 
stall" "--fallback-to-build" 
node-pre-gyp ERR! cwd C:\Users\ttheiner\NodeProjects\authtest\node_modules\bcryp 
t 
node-pre-gyp ERR! node -v v6.9.1 
node-pre-gyp ERR! node-pre-gyp -v v0.6.32 
node-pre-gyp ERR! not ok 
Failed to execute 'node-gyp.cmd configure --fallback-to-build --module=C:\Users\ 
ttheiner\NodeProjects\authtest\node_modules\bcrypt\lib\binding\bcrypt_lib.node - 
-module_name=bcrypt_lib --module_path=C:\Users\ttheiner\NodeProjects\authtest\no 
de_modules\bcrypt\lib\binding' (1) 
npm WARN [email protected] No repository field. 
npm WARN [email protected] No license field. 
npm ERR! Windows_NT 6.1.7601 
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\ttheiner\\AppDat 
a\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "install" "bcrypt" "--save" 

npm ERR! node v6.9.1 
npm ERR! npm v4.1.2 
npm ERR! code ELIFECYCLE 

npm ERR! [email protected] install: `node-pre-gyp install --fallback-to-build` 
npm ERR! Exit status 1 
npm ERR! 
npm ERR! Failed at the [email protected] install script 'node-pre-gyp install --fallb 
ack-to-build'. 
npm ERR! Make sure you have the latest version of node.js and npm installed. 
npm ERR! If you do, 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-pre-gyp install --fallback-to-build 
npm ERR! You can get information on how to open an issue for this project with: 
npm ERR!  npm bugs bcrypt 
npm ERR! Or if that isn't available, you can get their info via: 
npm ERR!  npm owner ls bcrypt 
npm ERR! There is likely additional logging output above. 

npm ERR! Please include the following file with any support request: 
npm ERR!  C:\Users\ttheiner\NodeProjects\authtest\npm-debug.log 

npmはあらかじめ構築されたバイナリを見つけることができないので、pythonを使ってソースをコンパイルしようとしています(私は持っていないようです)。

このためにPythonをインストールする必要はありますか?はいの場合、正しい方向に私を向けることができますか? bcryptの事前構築版がないのは事実ですか?

EDIT:Python 2.7をインストールした後で、MSBuildを使ってC++コードをコンパイルしようとしたようです。

C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppBuild.targets(366,5): warning MSB8003: Could not find WindowsSDKDir var 
iable from the registry. TargetFrameworkVersion or PlatformToolset may be set to an invalid version number. [C:\Users\ttheiner\NodeProject 
s\authtest\node_modules\bcrypt\build\bcrypt_lib.vcxproj] 
TRACKER : error TRK0005: Failed to locate: "CL.exe". The system cannot find the file specified. [C:\Users\ttheiner\NodeProjects\authtest\no 
de_modules\bcrypt\build\bcrypt_lib.vcxproj] 


gyp ERR! build error 
gyp ERR! stack Error: `C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe` failed with exit code: 1 
gyp ERR! stack  at ChildProcess.onExit (C:\Users\ttheiner\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\build.js:276:23) 

gyp ERR! stack  at emitTwo (events.js:106:13) 
gyp ERR! stack  at ChildProcess.emit (events.js:191:7) 
gyp ERR! stack  at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12) 
gyp ERR! System Windows_NT 6.1.7601 
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\ttheiner\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gy 
p\\bin\\node-gyp.js" "build" "--fallback-to-build" "--module=C:\\Users\\ttheiner\\NodeProjects\\authtest\\node_modules\\bcrypt\\lib\\binding 
\\bcrypt_lib.node" "--module_name=bcrypt_lib" "--module_path=C:\\Users\\ttheiner\\NodeProjects\\authtest\\node_modules\\bcrypt\\lib\\binding 
" 
gyp ERR! cwd C:\Users\ttheiner\NodeProjects\authtest\node_modules\bcrypt 
gyp ERR! node -v v6.9.1 
gyp ERR! node-gyp -v v3.5.0 
gyp ERR! not ok 
node-pre-gyp ERR! build error 
node-pre-gyp ERR! stack Error: Failed to execute 'node-gyp.cmd build --fallback-to-build --module=C:\Users\ttheiner\NodeProjects\authtest\no 
de_modules\bcrypt\lib\binding\bcrypt_lib.node --module_name=bcrypt_lib --module_path=C:\Users\ttheiner\NodeProjects\authtest\node_modules\bc 
rypt\lib\binding' (1) 
node-pre-gyp ERR! stack  at ChildProcess.<anonymous> (C:\Users\ttheiner\NodeProjects\authtest\node_modules\node-pre-gyp\lib\util\compile. 
js:83:29) 
node-pre-gyp ERR! stack  at emitTwo (events.js:106:13) 
node-pre-gyp ERR! stack  at ChildProcess.emit (events.js:191:7) 
node-pre-gyp ERR! stack  at maybeClose (internal/child_process.js:877:16) 
node-pre-gyp ERR! stack  at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5) 
node-pre-gyp ERR! System Windows_NT 6.1.7601 
node-pre-gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\ttheiner\\NodeProjects\\authtest\\node_modules\\node-pre-gyp\\bi 
n\\node-pre-gyp" "install" "--fallback-to-build" 
node-pre-gyp ERR! cwd C:\Users\ttheiner\NodeProjects\authtest\node_modules\bcrypt 
node-pre-gyp ERR! node -v v6.9.1 
node-pre-gyp ERR! node-pre-gyp -v v0.6.32 
node-pre-gyp ERR! not ok 
Failed to execute 'node-gyp.cmd build --fallback-to-build --module=C:\Users\ttheiner\NodeProjects\authtest\node_modules\bcrypt\lib\binding\b 
crypt_lib.node --module_name=bcrypt_lib --module_path=C:\Users\ttheiner\NodeProjects\authtest\node_modules\bcrypt\lib\binding' (1) 
npm WARN [email protected] No repository field. 
npm WARN [email protected] No license field. 
npm WARN Error: EPERM: operation not permitted, scandir 'C:\Users\ttheiner\NodeProjects\authtest\node_modules\dashdash\node_modules' 
npm WARN  at Error (native) 
npm WARN { Error: EPERM: operation not permitted, scandir 'C:\Users\ttheiner\NodeProjects\authtest\node_modules\dashdash\node_modules' 
npm WARN  at Error (native) 
npm WARN errno: -4048, 
npm WARN code: 'EPERM', 
npm WARN syscall: 'scandir', 
npm WARN path: 'C:\\Users\\ttheiner\\NodeProjects\\authtest\\node_modules\\dashdash\\node_modules' } 
npm ERR! Windows_NT 6.1.7601 
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\ttheiner\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "instal 
l" "bcrypt" "--save" 
npm ERR! node v6.9.1 
npm ERR! npm v4.1.2 
npm ERR! code ELIFECYCLE 

npm ERR! [email protected] install: `node-pre-gyp install --fallback-to-build` 
npm ERR! Exit status 1 
npm ERR! 
npm ERR! Failed at the [email protected] install script 'node-pre-gyp install --fallback-to-build'. 
npm ERR! Make sure you have the latest version of node.js and npm installed. 
npm ERR! If you do, 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-pre-gyp install --fallback-to-build 
npm ERR! You can get information on how to open an issue for this project with: 
npm ERR!  npm bugs bcrypt 
npm ERR! Or if that isn't available, you can get their info via: 
npm ERR!  npm owner ls bcrypt 
npm ERR! There is likely additional logging output above. 

npm ERR! Please include the following file with any support request: 
npm ERR!  C:\Users\ttheiner\NodeProjects\authtest\npm-debug.log 
+0

簡単Usagrとほぼ同じ機能を提供し

https://www.npmjs.com/package/bcrypt-nodejs

-nodejs bcryptのを使用することをお勧めだろう

'Python 2.x'は[npm](https://www.npmjs.com/package/bcrypt)に明示的に依存するものとしてリストされています。 –

+0

Python 2.7をインストールした後、奇妙なことに、エラーが変わります。最新の編集を参照してください – devnull69

+1

Windowsの[node-gyp documentation](https://www.npmjs.com/package/node-gyp)inatallation要件を参照してください。 – dNitro

答えて

4

あなたはこれを試すことができます。

最初のグローバルノードGYPをインストールします。

npm install node-gyp -g 

その後、私の答えは否決された理由私はわからない

npm install bcrypt --save 

を実行します。..私は、エラーメッセージから解決策を推測していました。

次の今回試すことができます:Visual Studioの2012/13エクスプレス(またはその他)をインストール

は、インストールのPython http://www.python.org/download/releases/2.7.5/ を (Windowsの7月8日)は、Windows SDKをインストールし のWin64のOpenSSL v1.0.1gをインストールします。管理者とテストがインストールとして

開く "VS2012のための開発者コマンドプロンプト":

その後

NPM INSTAL -g NPMインストールリットルノード-GYP bcryptの-gあなたは私に言わせれば、私はそれが

+0

いいえ、同じ結果 – devnull69

+0

@ devnull69最近編集したことを試してください。 –

+0

bcrypt-nodejsが勝者です – devnull69