When i try to start a new project i get the following errror:
$ ionic start HybridDemo sideMenu
Running start task...
Creating Ionic app in folder /Users/xxx/Desktop/HybridDemo based on sideMenu project
DOWNLOADING: https://github.com/driftyco/ionic-app-base/archive/master.zip
DOWNLOADING: https://github.com/driftyco/ionic-starter-sideMenu/archive/master.zip
Initializing cordova project.
Fetching plugin "org.apache.cordova.device" via plugin registry
Error: failed to fetch the plugin archive
at /usr/local/lib/node_modules/cordova/node_modules/plugman/src/registry/registry.js:60:26
at Request.cb [as _callback] (/usr/local/lib/node_modules/cordova/node_modules/plugman/src/registry/registry.js:251:9)
at self.callback (/usr/local/lib/node_modules/cordova/node_modules/plugman/node_modules/request/index.js:148:22)
at Request.EventEmitter.emit (events.js:117:20)
at ClientRequest.self.clientErrorHandler (/usr/local/lib/node_modules/cordova/node_modules/plugman/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:440:14
at process._tickCallback (node.js:415:13)
ERROR: Unable to add plugins. Perhaps your version of Cordova is too old. Try updating (npm install -g cordova), removing this project folder, and trying again.
Exiting.
reproduced on OSX and windows 8. obiuvsly cordova and ionic are up-to date
@Slumber86 any chance you are behind a proxy?
Yes I'm behind a proxy, but I've configured it correctly seems. Normally cordova works, and so npm. And, the zips with seed are downloaded correctly. Maybe there is a problem of parameters passing from ionic-cli to cordova plugin manager?.
Okay, I think it's definitely related to that, which is good as I finally have an idea why this is failing for some people :)
Stay tuned, I'll get this fixed
Sent from my iPhone
On Apr 23, 2014, at 8:21 AM, Agostino Marzotta [email protected] wrote:
Yes I'm behind a proxy, but I've configured it correctly seems. Normally cordova works, and so npm. And, the zips with seed are downloaded correctly. Maybe there is a problem of parameters passing from ionic-cli to cordova plugin manager?.
—
Reply to this email directly or view it on GitHub.
Fixed! Try adding PROXY ahead of the command:
$ PROXY=http://myproxy.com:8081 ionic start myApp
Seems that this is not working for me on Windows 7 x64, but with the PROXY env set, the error message change slightly. From this:
C:\Users\ggherardi\Temp\ionic>node_modules\.bin\ionic start myApp tabs
Running start task...
Creating Ionic app in folder C:\Users\ggherardi\Temp\ionic\myApp based on tabs project
DOWNLOADING: https://github.com/driftyco/ionic-app-base/archive/master.zip
TypeError: Cannot read property 'statusCode' of undefined
at Request._callback (C:\Users\ggherardi\Temp\ionic\node_modules\ionic\lib\ionic.js:257:13)
at self.callback (C:\Users\ggherardi\Temp\ionic\node_modules\ionic\node_modules\request\request.js:129:22)
at Request.EventEmitter.emit (events.js:95:17)
at ClientRequest.self.clientErrorHandler (C:\Users\ggherardi\Temp\ionic\node_modules\ionic\node_modules\request\request.js:239:10)
at ClientRequest.EventEmitter.emit (events.js:95:17)
at CleartextStream.socketErrorListener (http.js:1547:9)
at CleartextStream.EventEmitter.emit (events.js:95:17)
at Socket.onerror (tls.js:1445:17)
at Socket.EventEmitter.emit (events.js:117:20)
at net.js:833:16
To this:
C:\Users\ggherardi\Temp\ionic>SET PROXY=http://ggherardi:[email protected]:8090
C:\Users\ggherardi\Temp\ionic>node_modules\.bin\ionic start myApp tabs
Running start task...
Creating Ionic app in folder C:\Users\ggherardi\Temp\ionic\myApp based on tabs project
DOWNLOADING: https://github.com/driftyco/ionic-app-base/archive/master.zip
C:\Users\ggherardi\Temp\ionic\node_modules\ionic\lib\ionic.js:257
if(res.statusCode !== 200) {
^
TypeError: Cannot read property 'statusCode' of undefined
at Request._callback (C:\Users\ggherardi\Temp\ionic\node_modules\ionic\lib\ionic.js:257:13)
at self.callback (C:\Users\ggherardi\Temp\ionic\node_modules\ionic\node_modules\request\request.js:129:22)
at Request.EventEmitter.emit (events.js:95:17)
at ClientRequest.self.clientErrorHandler (C:\Users\ggherardi\Temp\ionic\node_modules\ionic\node_modules\request\request.js:239:10)
at ClientRequest.EventEmitter.emit (events.js:95:17)
at CleartextStream.socketErrorListener (http.js:1547:9)
at CleartextStream.EventEmitter.emit (events.js:95:17)
at SecurePair.<anonymous> (tls.js:1389:19)
at SecurePair.EventEmitter.emit (events.js:92:17)
at SecurePair.maybeInitFinished (tls.js:982:10)
After a bit of research, seems that it's and invalid HTTPS certificate, in fact the err parameter in the request callback has the following message:
https [Error: UNABLE_TO_VERIFY_LEAF_SIGNATURE]
Any workaround?
Given that my problem is not related to this issue, I've create another issue here: https://github.com/driftyco/ionic-cli/issues/30
Hi gimmi, hi Slumber86,
I have started the "node.js command prompt" on windows 8, then run the commands "SET NODE_TLS_REJECT_UNAUTHORIZED=0" & "SET PROXY=http://ggherardi:[email protected]:8090"
After that "ionic start myApp tabs" was not working, I receivied:
TypeError: Cannot read property 'statusCode' of undefined.
Was my PROXY setting wrong? what are the following parameters:
what must they be in my case?
thx
trying to find my proxy, I received :
No proxies were detected.
Are there any hints what the syntax would be to use NTLM authentication (domain, username, password) for the proxy?
set PROXY=http://domain\username:password@server:port
doesn't seem to work
@mlynch Can you add a note about that proxy thingy on Ionic's Getting Started page? I'm sure many will appreciate
Hi, using set proxy=http://server:port before running the ionic cli worked
@saamorim It works. ^_^
Why not using the standard "http_proxy" and "https_proxy" env variables? Pretty much all osx/linux programs support these (including cordova, npm, git...)
@sinedied
Your solution worked for me..!!! Thanks ...
I set my proxy as below :
C:\Users\naj>npm config set proxy http://myUserName:[email protected]:8000
C:\Users\naj>npm config set https-proxy http://myUserName:[email protected]:8000
and upadate the same in system environment variable "http_proxy" and "https_proxy". Cloased the cmd prompt once and i opend again ,it worked well..!!!
@vincesp My idea of doing all these stuff behind NTLM proxy is that use CNTLM to convert your NTLM proxy into a local proxy server which does not require any usernames or passwords. It really makes my life a lot easier.
Here's what I found in Win7.
Setting NPM proxy is not going work with this. I tried forwarding to fiddler by setting the npm proxy and https-proxy like
npm set proxy=http://localhost:8888
and fillder would not capture the request.
I then simply set the proxy like
set proxy=http://localhost:8888 and fillder captured the request and started downloading it.
I think CNTLM will work too. I usually switch between setting the actual proxy
http://username:password@domain:port, fiddler and CNTLM. When none of these work I simply try to download the package or get it working on my home pc and copy over. Windows complains about too many characters in path but somehow after that it manages to work with the proxy.
Most helpful comment
Hi, using
set proxy=http://server:portbefore running the ionic cli worked