Codeship Basic npm install fails Error: SSL Error: CERT_UNTRUSTED - node.js

I'm having a consistent issue where my Codeship Basic setup step is failing when running npm install:
npm http GET https://registry.npmjs.org/babel-runtime
npm ERR! Error: SSL Error: CERT_UNTRUSTED
npm ERR! at ClientRequest.<anonymous> (/home/rof/.nvm/v0.6.21/lib/node_modules/npm/node_modules/request/main.js:440:26)
npm ERR! at ClientRequest.g (events.js:156:14)
npm ERR! at ClientRequest.emit (events.js:67:17)
npm ERR! at HTTPParser.parserOnIncomingClient [as onIncoming] (http.js:1256:7)
npm ERR! at HTTPParser.parserOnHeadersComplete [as onHeadersComplete] (http.js:91:29)
npm ERR! at CleartextStream.socketOnData [as ondata] (http.js:1288:20)
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! [Error: SSL Error: CERT_UNTRUSTED]
npm ERR! You may report this log at:
npm ERR! <http://github.com/isaacs/npm/issues>
npm ERR! or email it to:
npm ERR! <npm-#googlegroups.com>
npm ERR! System Linux 4.2.0-42-generic
npm ERR! command "node" "/home/rof/.nvm/v0.6.21/bin/npm" "install"
npm ERR! cwd /home/rof/src/
npm ERR! node -v v0.6.21-pre
npm ERR! npm -v 1.1.37
npm ERR! message SSL Error: CERT_UNTRUSTED
npm http GET https://registry.npmjs.org/axios
The same npm install / package.json works without issue on my local system.
I'm trying to avoid just disabling SSL certificate verification as that doesn't seem like the right fix to the underlying problem.
Anybody else seen this when using Codeship?

npm ERR! node -v v0.6.21-pre
npm ERR! npm -v 1.1.37
This appears to be an end of life issue with node versions.
You are running older versions of both node and NPM, and the SSL get's shut off. Essentially the only options are using non-SSL registries, or using a newer version of node/npm.
npm config set strict-ssl false
npm config set registry="http://registry.npmjs.org/"
I don't believe that the npm client included with Node 0.6 contains the necessary certificates to connect to the npm registry over SSL. SSL certificates expire, as you know, and so this is simply a natural consequence of using old software to connect to SSL servers, from what I understand.
I'm linking to the NPM issue - https://github.com/npm/npm/issues/4391

Related

Macbook cannot install hexo

Here is the log:
npm ERR! Error: read ETIMEDOUT
npm ERR! at errnoException (net.js:863:11)
npm ERR! at TCP.onread (net.js:524:19)
npm ERR! If you need help, you may report this log at:
npm ERR! <http://github.com/isaacs/npm/issues>
npm ERR! or email it to:
npm ERR! <npm-#googlegroups.com>
npm ERR! System Darwin 14.1.0
npm ERR! command "/Users/JianqingJiang/~/nvm/v0.10.0/bin/node" "/Users/JianqingJ
npm ERR! cwd /
npm ERR! node -v v0.10.0
npm ERR! npm -v 1.2.14
npm ERR! syscall read
npm ERR! code ETIMEDOUT
npm ERR! errno ETIMEDOUT
npm http GET https://registry.npmjs.org/abbrev
I install the git and node.js and looks good but when I want to install hexo, the error shows up.
As mentioned in the comments, full command would help. I will assume that you were doing npm install hexo...
What can be deduced here is that npm tried to obtain theabbrev package (the first dependency of hexo, btw) and the HTTP request timed out.
So you should check your network connection etc (proxies ...) and try again. I just installed here without issue.

Error: failed to fetch from registry: kanso

While Im in the process of configuring Kleks i wanted to install kanso according to this github article.
I successfully installed the npm and try to install kanso afterword, This is the command that used:
stratos#Dev-PC:~$ sudo npm install -g kanso
Error log:
npm http GET https://registry.npmjs.org/kanso
npm ERR! Error: failed to fetch from registry: kanso
npm ERR! at /usr/share/npm/lib/utils/npm-registry-client/get.js:139:12
npm ERR! at cb (/usr/share/npm/lib/utils/npm-registry-client/request.js:31:9)
npm ERR! at Request._callback (/usr/share/npm/lib/utils/npm-registry-client/request.js:136:18)
npm ERR! at Request.callback (/usr/lib/nodejs/request/main.js:119:22)
npm ERR! at Request.<anonymous> (/usr/lib/nodejs/request/main.js:212:58)
npm ERR! at Request.emit (events.js:88:20)
npm ERR! at ClientRequest.<anonymous> (/usr/lib/nodejs/request/main.js:412:12)
npm ERR! at ClientRequest.emit (events.js:67:17)
npm ERR! at HTTPParser.onIncoming (http.js:1261:11)
npm ERR! at HTTPParser.onHeadersComplete (http.js:102:31)
npm ERR! You may report this log at:
npm ERR! <http://bugs.debian.org/npm>
npm ERR! or use
npm ERR! reportbug --attach /home/stratos/npm-debug.log npm
npm ERR!
npm ERR! System Linux 3.11.0-26-generic
npm ERR! command "node" "/usr/bin/npm" "install" "-g" "kanso"
npm ERR! cwd /home/stratos
npm ERR! node -v v0.6.12
npm ERR! npm -v 1.1.4
npm ERR! message failed to fetch from registry: kanso
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/stratos/npm-debug.log
npm not ok
stratos#Dev-PC:~$
My internet connection is working properly. What is the reason for this issue?
This is due to the ubuntu version that I used, which is older version of ubuntu 12.04. I ran the same code in ubuntu later version it worked successfully. Since Im using npm i have no other choice than upgrading the ubuntu version. Hope npm will fix this backward capability issue in there future releases.

Proxy settings in npm-yeoman

I am building my angular application using yeoman.
I have set proxies and registry as follows:
npm config set proxy http://proxy.tcs.com:8080
npm config set https-proxy http://proxy.tcs.com:8080
npm config set registry http://registry.npmjs.org/
Even after setting proxy as above,while installing
npm install grunt-ngmin,
I get the following error,
npm WARN package.json teamshareangular#0.0.0 No README.md file found!
npm http GET http://registry.npmjs.org/grunt-ngmin
npm http 407 http://registry.npmjs.org/grunt-ngmin
npm ERR! registry error parsing json
npm ERR! SyntaxError: Unexpected token <
npm ERR! <HEAD><TITLE>Proxy Authorization Required</TITLE></HEAD>
npm ERR! <BODY BGCOLOR="white" FGCOLOR="black"><H1>Proxy Authorization Required</H1><HR>
npm ERR! <FONT FACE="Helvetica,Arial"><B>
npm ERR! Description: Authorization is required for access to this proxy</B></FONT>
npm ERR! <HR>
npm ERR! <!-- default "Proxy Authorization Required" response (407) -->
npm ERR! </BODY>
npm ERR!
npm ERR! at Object.parse (native)
npm ERR! at RegClient.<anonymous> (C:\Users\Documents\tools\nodejs\nodejs\node_modules\npm\node_modules\npm-registry-client\lib\request.js:235:23)
npm ERR! at Request.self.callback (C:\Users\Documents\tools\nodejs\nodejs\node_modules\npm\node_modules\request\main.js:120:22)
npm ERR! at Request.EventEmitter.emit (events.js:98:17)
npm ERR! at Request.<anonymous> (C:\Users\Documents\tools\nodejs\nodejs\node_modules\npm\node_modules\request\main.js:648:16)
npm ERR! at Request.EventEmitter.emit (events.js:117:20)
npm ERR! at IncomingMessage.<anonymous> (C:\Users\Documents\tools\nodejs\nodejs\node_modules\npm\node_modules\request\main.js:610:14)
npm ERR! at IncomingMessage.EventEmitter.emit (events.js:117:20)
npm ERR! at _stream_readable.js:910:16
npm ERR! at process._tickCallback (node.js:415:13)
npm ERR! If you need help, you may report this log at:
npm ERR! <http://github.com/isaacs/npm/issues>
npm ERR! or email it to:
npm ERR! <npm-#googlegroups.com>
npm ERR! System Windows_NT 6.1.7601
npm ERR! command "C:\\Users\\\Documents\\tools\\nodejs\\nodejs\\\\node.exe" "C:\\Users\\\Documents\\tools\\nodejs\\nodejs\\node_modules\\npm\\bin\\npm-cli.j
"grunt-ngmin"
npm ERR! cwd C:\nodejs\Teamshare\Teamshareangular
npm ERR! node -v v0.10.7
npm ERR! npm -v 1.2.14
npm ERR! type unexpected_token
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! C:\nodejs\Teamshare\Teamshareangular\npm-debug.log
npm ERR! not ok code 0
What is to be done for this?
Should I make some other settings in npm?
Please advice.
Your proxy needs authentication. If you have proxy in your control then create a user and use the folowing command to configure npm to use your credectials. (Note the user & pass before hostname)
$ npm config set proxy http://login:pass#host:port
$ npm config set https-proxy http://login:pass#host:port
For various reasons, the most obvious being security, you might want to avoid putting your proxy credentials in clear text into the npm config.
You can however install a local forwarding proxy that offloads the proxy authentication. Personally, I use squid (in combination with SquidMan, a few colleagues use cntlm. Cntlm has quirks and is unmaintained afaict, but squid works quite well for me.
I run squid on localhost:4321 and configure npm to connect to http://localhost:4321. Squid then authenticates against the corporate proxy with stored, encrypted credentials.

Error installing node-modules via npm

I am trying to install node module redis v0.9.0 locally via npm. I have downloaded the tgz file from https://registry.npmjs.org/redis/-/redis-0.9.0.tgz. Now, when i try to execute the command npm install redis-0.9.0.tgz, it is trying to download again from the repository instead of just unpacking and installing. I am trying the command on linux environment. I am not getting why it tries to download.
npm http GET https://registry.npmjs.org/redis-0.9.0.tgz
npm http GET https://registry.npmjs.org/redis-0.9.0.tgz
npm http GET https://registry.npmjs.org/redis-0.9.0.tgz
npm ERR! Error: DEPTH_ZERO_SELF_SIGNED_CERT
npm ERR! at SecurePair.<anonymous> (tls.js:1283:32)
npm ERR! at SecurePair.EventEmitter.emit (events.js:92:17)
npm ERR! at SecurePair.maybeInitFinished (tls.js:896:10)
npm ERR! at CleartextStream.read [as _read] (tls.js:430:15)
npm ERR! at CleartextStream.Readable.read (_stream_readable.js:320:10)
npm ERR! at EncryptedStream.write [as _write] (tls.js:344:25)
npm ERR! at doWrite (_stream_writable.js:219:10)
npm ERR! at writeOrBuffer (_stream_writable.js:209:5)
npm ERR! at EncryptedStream.Writable.write (_stream_writable.js:180:11)
npm ERR! at write (_stream_readable.js:573:24)
npm ERR! If you need help, you may report this log at:
npm ERR! <http://github.com/isaacs/npm/issues>
npm ERR! or email it to:
npm ERR! <npm-#googlegroups.com>
npm ERR! System Linux 2.6.32-220.13.1.el6.x86_64
npm ERR! command "/usr/local/bin/node" "/usr/local/bin/npm" "install" "redis-0.9.0.tgz"
npm ERR! cwd /home/abc/download
npm ERR! node -v v0.10.6
npm ERR! npm -v 1.2.18
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/abc/download/npm-debug.log
npm ERR! not ok code 0
Try to install it in this way:
npm install ./redis-0.9.0.tgz

Error on Installing mobify-client

I got this error while trying to install mobify client. My node.js version is: 0.8.6 and npm: 1.1.48. Also I am behind a proxy and in first row I just set proxy but I dont know is this act as same as setting http_proxy variable?
C:\Users\user>npm config set proxy http://user:pass#proxy:port
C:\Users\user>npm -g install mobify-client
npm http GET https://registry.npmjs.org/mobify-client
npm http GET https://registry.npmjs.org/mobify-client
npm http GET https://registry.npmjs.org/mobify-client
npm http GET https://registry.npmjs.org/-/mobify-client-0.3.8.tgz
npm ERR! fetch failed https://registry.npmjs.org/-/mobify-client-0.3.8.tgz
npm http GET https://registry.npmjs.org/-/mobify-client-0.3.8.tgz
npm ERR! fetch failed https://registry.npmjs.org/-/mobify-client-0.3.8.tgz
npm http GET https://registry.npmjs.org/-/mobify-client-0.3.8.tgz
npm ERR! fetch failed https://registry.npmjs.org/-/mobify-client-0.3.8.tgz
npm ERR! Error: SSL Error: Hostname/IP doesn't match certificate's altnames
npm ERR! at ClientRequest.<anonymous> (C:\Program Files (x86)\nodejs\node_mo
dules\npm\node_modules\request\main.js:440:26)
npm ERR! at ClientRequest.g (events.js:185:14)
npm ERR! at ClientRequest.EventEmitter.emit (events.js:88:17)
npm ERR! at HTTPParser.parserOnIncomingClient (http.js:1455:7)
npm ERR! at HTTPParser.parserOnHeadersComplete [as onHeadersComplete] (http.js:111:23)
npm ERR! at CleartextStream.socketOnData (http.js:1366:20)
npm ERR! at CleartextStream.CryptoStream._push (tls.js:485:27)
npm ERR! at SecurePair.cycle (tls.js:839:20)
npm ERR! at EncryptedStream.CryptoStream.write (tls.js:220:13)
npm ERR! at Socket.ondata (stream.js:38:26)
npm ERR! If you need help, you may report this log at:
npm ERR! <http://github.com/isaacs/npm/issues>
npm ERR! or email it to:
npm ERR! <npm-#googlegroups.com>
npm ERR! System Windows_NT 6.1.7601
npm ERR! command "C:\\Program Files (x86)\\nodejs\\\\node.exe" "C:\\Program Files (x86)\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "-g" "install" "mobify-client"
npm ERR! cwd C:\Users\user
npm ERR! node -v v0.8.6
npm ERR! npm -v 1.1.48
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! C:\Users\user\npm-debug.log
npm ERR! not ok code 0
It seems like there could have been two potential issues here. One is that the npm server may have had some issues at the time, you might want to try again now and see if you get the same error. The same question was asked in our Support forums (may even have been asked by you :) ) and another user said that trying again later fixed the issue:
https://support.mobify.com/customer/portal/questions/445465-installation-error
Another issue is that you may be behind a proxy and can't connect to the npm server. You can set the proxy location using this command:
npm config set proxy http://url:port
Or if the proxy is authenticated:
npm config set proxy http://user:pass#url:port

Resources