cordovaのプロキシ設定
以下のようなエラーが出る場合、プロキシの設定が原因として考えられる。
C:\hello>cordova plugin search bar code Error: getaddrinfo ENOTFOUND at errnoException (dns.js:37:11) at Object.onanswer [as oncomplete] (dns.js:124:16)
C:\hello>cordova plugin add org.apache.cordova.device Fetching plugin "org.apache.cordova.device" via plugin registry Error: Failed to fetch package information for org.apache.cordova.device at C:\Users\user\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\src\plugman\registry\registry.js:32:20 at Request.cb [as _callback] (C:\Users\user\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\src\plugman\registry\registry.js:251:9) at self.callback (C:\Users\user\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\node_modules\request\index.js:148:22) at Request.EventEmitter.emit (events.js:117:20) at ClientRequest.self.clientErrorHandler (C:\Users\user\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\node_modules\request\index.js:257:10) at ClientRequest.EventEmitter.emit (events.js:95:17) at Socket.socketErrorListener (http.js:1547:9) at Socket.EventEmitter.emit (events.js:95:17) at net.js:833:16 at process._tickCallback (node.js:419:13)
以下のコマンドに加えて
npm config set proxy http://username%40company.example.com:password@proxy.example.com:8080 npm config set https-proxy http://username%40company.example.com:password@proxy.example.com:8080
追加で以下も設定する。
plugman config set proxy http://username%40company.example.com:password@proxy.example.com:8080 plugman config set https-proxy http://username%40company.example.com:password@proxy.example.com:8080
%40 は @ をパーセントエンコーディングしたもの
- いいね!Androidアプリ: Cordovaインストールとプロキシエラーについて
http://papakingyo-android.blogspot.jp/2014/01/cordova.html - いいね!Androidアプリ: プラグイン追加に於けるエラーについて Cordova(PhoneGap)
http://papakingyo-android.blogspot.jp/2014/04/cordovaphonegap.html - [CB-5017] There is no way to set a proxy for plugman - ASF JIRA
https://issues.apache.org/jira/browse/CB-5017 - [CB-6196] plugman and CLI should use the same proxy settings - ASF JIRA
https://issues.apache.org/jira/browse/CB-6196
CB-6196のステータスはまだオープン