GeoSal
GeoSal

Reputation: 333

Can't create a cordova project, proxy issue?

I'm trying to create a project after installing cordova via the command line : npm install -g cordova. The installation apparently goes well, I don't get errors, except couple of warnings which I don't know the cause :

npm WARN engine [email protected]: wanted: {"node":"~0.10.x"} (current: {"node":"0.12.0","npm":"2.5.1"})
npm WARN engine [email protected]: wanted: {"node":">=0.6","npm":"1"} (current: {"node": "0.12.0","npm":"2.5.1"})
npm WARN engine [email protected]: wanted: {"node":"0.8.x || 0.10.x"} (current: {"node":"0.12.0","npm":"2.5.1"})
C:\Users\SALWA\AppData\Roaming\npm\cordova -> C:\Users\SALWA\AppData\Roaming\npm\node_modules\cordova\bin\cordova
[email protected] C:\Users\SALWA\AppData\Roaming\npm\node_modules\cordova
├── [email protected]
├── [email protected]
├── [email protected] ([email protected])
└── [email protected] ([email protected], [email protected], properties-parser@0.
2.3, [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected])

After this, I try to create a project using the following command line : cordova create electionscasa com.geomatic.electionscasa ElectionsCasa but then I get this error :

Creating a new cordova project with name "ElectionsCasa" and id "com.geomatic.electionscasa" at location "C:\myApp\electionscasa"
Downloading cordova library for www...
Error: tunneling socket could not be established, cause=connect ECONNREFUSED
at ClientRequest.onError (C:\Users\SALWA\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\node_modules\request\node_modules\tunnel-agent\index.js:168:17)
at ClientRequest.g (events.js:199:16)
at ClientRequest.emit (events.js:107:17)
at Socket.socketErrorListener (_http_client.js:272:9)
at Socket.emit (events.js:107:17)
at net.js:451:14
at process._tickCallback (node.js:355:11)

I've looked for a solution to this problem but I couldn't find any although I think it's related to the proxy ? So I took a look on the environment variables and didn't find : http_proxy nor https_proxy.. So I added them and set them respectively to :

HTTP_PROXY:    http://localhost:8080
HTTPS_PROXY:    https://localhost:8080

I re-typed the previous command but still get the same error.. Please help as I'm stuck with this error and can't move forward.. Thanks in advance!

P.S: I've installed NodeJS beforehand and I'm working on my local machine (not a corporate), under windows 7.

Upvotes: 1

Views: 897

Answers (1)

Michael Blankenship
Michael Blankenship

Reputation: 1669

You might try:

npm config set registry=http://registry.npmjs.org/

or

npm config set strict-ssl false

If that seems to work then it has to do with the self-signed certificate on the server in question.

Upvotes: 1

Related Questions