1

Good day every one,

I tried to install Phonegap in my PC but i counter the problem hopefully any can help me.

Here's the ubuntu version

Distributor ID: Ubuntu 
Description:    Ubuntu 12.04.4 LTS 
Release:    12.04 
Codename:   precise 

Here's the error during my installation

$ npm http GET https://registry.npmjs.org/phonegap 
npm ERR! Error: SSL Error: CERT_UNTRUSTED 
npm ERR! at ClientRequest. (/usr/local/lib/node_modules/npm/node_modules/request/main.js:483:26) 
npm ERR! at ClientRequest.g (events.js:156:14) 
npm ERR! at ClientRequest.emit (events.js:67:17) 
npm ERR! at HTTPParser.onIncoming (http.js:1294:11) 
npm ERR! at HTTPParser.parserOnHeadersComplete [as onHeadersComplete] (http.js:91:29) 
npm ERR! at CleartextStream.ondata (http.js:1176:24) 
npm ERR! at CleartextStream._push (tls.js:375:27) 
npm ERR! at SecurePair.cycle (tls.js:734:20) 
npm ERR! at EncryptedStream.write (tls.js:130:13) 
npm ERR! at Socket.ondata (stream.js:38:26) 
npm ERR! You may report this log at: 
npm ERR! 
npm ERR! or email it to: 
npm ERR! 
npm ERR! 
npm ERR! System Linux 3.8.0-37-generic 
npm ERR! command "node" "/usr/local/bin/npm" "install" "-gf" "phonegap" 
npm ERR! cwd /home/my_name 
npm ERR! node -v v0.6.17 
npm ERR! npm -v 1.1.21 
npm ERR! message SSL Error: CERT_UNTRUSTED 
npm ERR! 
npm ERR! Additional logging details can be found in: 
npm ERR! /home/my_name/npm-debug.log 
npm not ok 

Thanks,
Wang

Danatela
  • 13,243
  • 11
  • 45
  • 72
delabahan
  • 11
  • 3

2 Answers2

0

Hopefully you found an answer in the last 6 months, but in case anyone is still running into this problem, here are some options:

Update Node + NPM

If you installed Node.js through the official 12.04 repositories (which looks like the case, from this line: node -v v0.6.17), your Node version is badly out of date by now.

Back in late February, shortly before this question was posted, npm stopped supporting self-signed certificates. As a result, lots of people working on Node projects ran into similar issues. The fix? Update npm.

For instructions on upgrading, see this question on AskUbuntu. Personally, I recommend managing Node versions using NVM, but you can also get the latest version via PPA.

Living behind a proxy

It's also possible to run into issues like these if you're trying to access the npm repository from behind a proxy (e.g. at a corporate office). While this is less likely to be your issue, it can be solved by the following (taken from here):

npm config set proxy http://proxy.company.com:8080
npm config set https-proxy http://proxy.company.com:8080

You can also set a proxy for a single npm install command by running:

npm --https-proxy=http://proxy.company.com install express -g

Don't disable SSL checks

It's true that you can suppress the error by setting npm's strict-ssl setting to false. Disabling security warnings is a bad idea.

-1

Try setting:

npm config set strict-ssl false
Eliah Kagan
  • 117,780