2017-06-08 73 views
2

WebstormとNode.jsを使用して、ursaモジュールをnpmでインストールしようとしています。このモジュールは、別のモジュールの前提条件であるため、このモジュールが必要です。npmエラーUNABLE_TO_GET_ISSUER_CERT_LOCALLY、証明書のバンドルとそのバンドルから.pemファイルを生成する方法は?

私がインストールすると、インストールはnode-gyp rebuildで失敗します。

コンソール出力はのようになります。必要であれば、私は、ログ・ファイルを提供することができます

C:\Users\{Me}>npm install ursa --save 
> [email protected] install C:\Users\{Me}\node_modules\ursa 
> node-gyp rebuild 

C:\Users\Me\node_modules\ursa>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) 
gyp WARN install got an error, rolling back install 
gyp ERR! configure error 
gyp ERR! stack Error: unable to get local issuer certificate 
gyp ERR! stack  at Error (native) 
gyp ERR! stack  at TLSSocket.<anonymous> (_tls_wrap.js:1092:38) 
gyp ERR! stack  at emitNone (events.js:86:13) 
gyp ERR! stack  at TLSSocket.emit (events.js:185:7) 
gyp ERR! stack  at TLSSocket._finishInit (_tls_wrap.js:610:8) 
gyp ERR! stack  at TLSWrap.ssl.onhandshakedone (_tls_wrap.js:440:38) 
gyp ERR! System Windows_NT 6.1.7601 
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" 
"C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" 
gyp ERR! cwd C:\Users\{Me}\node_modules\ursa 
gyp ERR! node -v v6.11.0 
gyp ERR! node-gyp -v v3.4.0 
gyp ERR! not ok 
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected]^1.0.0 (node_modules\chokidar\node_modules\fsevents): 
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"}) 
npm ERR! Windows_NT 6.1.7601 
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "ursa" "--save" 
npm ERR! node v6.11.0 
npm ERR! npm v3.10.10 
npm ERR! code ELIFECYCLE 

npm ERR! [email protected] install: `node-gyp rebuild` 
npm ERR! Exit status 1 
npm ERR! 
npm ERR! Failed at the [email protected] install script 'node-gyp rebuild'. 
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 ursa 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 information on how to open an issue for this project with: 
npm ERR!  npm bugs ursa 
npm ERR! Or if that isn't available, you can get their info via: 
npm ERR!  npm owner ls ursa 
npm ERR! There is likely additional logging output above. 

npm ERR! Please include the following file with any support request: 
npm ERR! C:\Users\p704644d\{Me}\npm-debug.log 

私はGoogleで検索していることが分かった:

NPMのERR!コードUNABLE_TO_GET_ISSUER_CERT_LOCALLY

このエラーは、不明な認証局(CA)によって署名された というTLS証明書がチェーンに存在することを意味します。おそらく、 これは、自分のHTTPSプロキシが使用する証明書です。あなたは、あなたが.CRT 1から.pemファイルを生成することができますする必要がある場合

$のNPMの設定セットは

を/path/to/your/file.pem cafile: ソリューションはcafile値を設定することです:

出典:https://github.com/npm/npm/wiki/Troubleshooting

$ opensslのX509 -informデル-in /path/to/the.crt -out /path/to/the/file.pem

問題は、インストールに失敗した証明書と、.pemファイルを生成する方法を知る方法です。 1つの.pemファイルを取得するために証明書を見つけるべき場所とその証明書をバンドルする方法は? (Win 7)

答えて

0

SSL検査でSSL証明書を交換する企業ファイアウォールの背後にある場合は、ネットワーク管理者に証明書ファイルを問い合わせてください。それ以外の場合は、証明書が交換されているWebサイトに接続してFirefoxまたはChromeを使用してダウンロードできます。その後、How to add custom certificate authority (CA) to nodejsで回答したように、NODE_EXTRA_CA_CERTSを使用して証明書ファイルをNode.jsに提供することができます。

関連する問題