2016-11-18 22 views
0

on windows 10 node:v6.7.0、npm:v4.0.1 node-gyp:v3.4.0、私はこれらのエラーに直面してnpm install --save bcryptを試しています。これは私のパスにpython27とpython35-32の両方がある場所です。npmはbcrypt、gyp ERRをインストールします。 python

D:\myApp\node_modules\bcrypt>if not defined npm_config_node_gyp (node "C:\Users\myname\AppData\Roaming\npm\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild) else (node "" rebuild) 
gyp ERR! configure error 
gyp ERR! stack Error: Python executable "C:\Users\myname\AppData\Local\Programs\Python\Python35-32\python.EXE" is v3.5.2, which is not supported by gyp. 
gyp ERR! stack You can pass the --python switch to point to Python >= v2.5.0 & < 3.0.0. 
gyp ERR! stack  at failPythonVersion (C:\Users\Amirhossein\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\configure.js:454:14) .... 

私はそれはOKらしいnpm install --save --python=phyton2.7 bcrypt

をインストールしようとしたが、警告がたくさんインストールが完了:

D:\myApp\node_modules\bcrypt>if not defined npm_config_node_gyp (node "C:\Users\myname\AppData\Roaming\npm\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\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 
    win_delay_load_hook.cc 
..\src\bcrypt.cc(232): warning C4267: '=': conversion from 'size_t' to 'unsigned char', possible loss of data [D:\myApp\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 [D:\myApp\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 [D:\myApp\node_modules\bcrypt\build\bcrypt_lib.vcxproj] 
..\src\bcrypt_node.cc(230): warning C4267: 'initializing': conversion from 'size_t' to 'int', possible loss of data [D:\myApp\node_modules\bcrypt\build\bcrypt_lib.vcxproj] 

それが正常に動作しますか? bcryptをインストールする正しい方法は何ですか?私はnode-gypでconfigを変更すべきですか?

答えて

2

最も簡単な解決策:溝パイソンbcryptの代わりに、bcryptの-nodejsを使用します。https://github.com/shaneGirish/bcrypt-nodejs

+1

は、これと同等の機能ですか? –

+1

あなたはパフォーマンスについて気にしないなら、IMHOはうまくいきます(はい、私はbcryptの目的を知っていますが、純粋なjavascriptでbcryptを実行しても不必要なパフォーマンスが残ります)。 – mscdex

-1

を警告していないコンパイラエラーのみがある場合あなたを伝えるNPMからテキストのブロックを見ることになるので、(これは明らかであろうアドオンのインストールに問題がありました)、うまくいくはずです。

0

もしあなたがbcryptをディッチしているのであれば、私はbcryptjsを使用することを勧めます。これは0の依存性を持つbcryptと互換性があります。 はい、それはperformance hitが発生しますが、それで問題なければ、node-gyp rebuild hellの外に出てしまいます。

関連する問題