0
votes

I'm trying to complete the Polymer tutorial on a Mac. However, upon trying to load the starter kit, I run into the following error:

? Which starter template would you like to use? polymer-2-starter-kit info: Running template polymer-2-starter-kit... info: Finding latest ^3.0.0 release of PolymerElements/polymer-starter-kit error:
Uncaught exception: getaddrinfo ENOTFOUND api.github.com api.github.com:443 error: Error: getaddrinfo ENOTFOUND api.github.com api.github.com:443 at __dirname.sendError (/usr/local/lib/node_modules/polymer-cli/node_modules/github/lib/index.js:838:19) at /usr/local/lib/node_modules/polymer-cli/node_modules/github/lib/index.js:849:29 at callCallback (/usr/local/lib/node_modules/polymer-cli/node_modules/github/lib/index.js:713:17) at ClientRequest. (/usr/local/lib/node_modules/polymer-cli/node_modules/github/lib/index.js:791:17) at emitOne (events.js:96:13) at ClientRequest.emit (events.js:188:7) at TLSSocket.socketErrorListener (_http_client.js:309:9) at emitOne (events.js:96:13) at TLSSocket.emit (events.js:188:7) at connectErrorNT (net.js:1021:8) 1147425-FVFTM15DH3QK:Polymer test

I'm pretty sure this is because of the company proxy I'm behind. However, trying to launch it by explicitly stating the proxy (eg. https_proxy=http://proxy:port http_proxy=http://proxy:port polymer init polymer-2-starter-kit) results in the same. How can I make sure the starter kit loads? Thank you!

2

2 Answers

0
votes

You need to Set proxies

For GitHub the commands are

git config --global http.proxy whatever-url

git config --global https.proxy whaterver-url

You will even need to do those at node Level, as when it tries to do npm install it will need those.

The commands are

npm config set proxy whatever-url

npm config set https-proxy whatever-url

While the starter kit tries to do bower install, it will fail as it is behind proxy.

Create a .bowerrc file & Keep the following contents there

{
    "directory": "bower_components",
    "proxy": "whatever url",
    "https-proxy": "whatever url"
}
0
votes

Quite old thread but I just came across same issue. As this issue is fixed in ploymer-cli here

So if you are on Linux run following to set http and https proxy

export HTTP_PROXY='http://<proxyhost>:<port>' 
export HTTPS_PROXY='http://<proxyhost>:<port>'

Note: Please use HTTP_PROXY not the http_proxy (lower case) as above mentioned fix made uses upper case key. I wasted quite some time since I was setting proxy using lower case