Error installing node-modules via npm - node.js

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

Related

SOCKET INSTALL IN UBUNTU 18.04

AM getting this error if i use
sudo npm install -g n
I used the above to install socket but facing the below errors
npm http GET https://registry.npmjs.org/socket.io
npm ERR! Error: SSL Error: CERT_UNTRUSTED
npm ERR! at ClientRequest.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/request/main.js:525:26)
npm ERR! at ClientRequest.g (events.js:192:14)
npm ERR! at ClientRequest.EventEmitter.emit (events.js:96:17)
npm ERR! at HTTPParser.parserOnIncomingClient [as onIncoming] (http.js:1462:7)
npm ERR! at HTTPParser.parserOnHeadersComplete [as onHeadersComplete] (http.js:111:23)
npm ERR! at CleartextStream.socketOnData [as ondata] (http.js:1367:20)
npm ERR! at CleartextStream.CryptoStream._push (tls.js:526:27)
npm ERR! at SecurePair.cycle (tls.js:880:20)
npm ERR! at EncryptedStream.CryptoStream.write (tls.js:267: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 Linux 4.18.0-15-generic
npm ERR! command "/usr/local/bin/node" "/usr/local/bin/npm" "install" "socket.io"
npm ERR! cwd /home/afreed
npm ERR! node -v v0.8.15
npm ERR! npm -v 1.1.66
npm ERR! code ESSL
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/afreed/npm-debug.log
npm ERR! not ok code 0
afreed#JARVIS:~$ sudo npm install -g n
npm http GET https://registry.npmjs.org/n
npm ERR! Error: SSL Error: CERT_UNTRUSTED
npm ERR! at ClientRequest.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/request/main.js:525:26)
npm ERR! at ClientRequest.g (events.js:192:14)
npm ERR! at ClientRequest.EventEmitter.emit (events.js:96:17)
npm ERR! at HTTPParser.parserOnIncomingClient [as onIncoming] (http.js:1462:7)
npm ERR! at HTTPParser.parserOnHeadersComplete [as onHeadersComplete] (http.js:111:23)
npm ERR! at CleartextStream.socketOnData [as ondata] (http.js:1367:20)
npm ERR! at CleartextStream.CryptoStream._push (tls.js:526:27)
npm ERR! at SecurePair.cycle (tls.js:880:20)
npm ERR! at EncryptedStream.CryptoStream.write (tls.js:267: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 Linux 4.18.0-15-generic
npm ERR! command "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "n"
npm ERR! cwd /home/afreed
npm ERR! node -v v0.8.15
npm ERR! npm -v 1.1.66
npm ERR! code ESSL
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/afreed/npm-debug.log
npm ERR! not ok code 0
try this :
npm config set registry="http://registry.npmjs.org/"
or clear cache of your npm:
sudo npm cache clean -f
sudo npm install -g n
sudo n stable
or simply you can turn off ssl_cert (not recommended):
npm config set strict-ssl false

Cannot install less on Centos 6.6 by npm (Error: failed to fetch from registry: less)

I want to install less module on Centos 6.6 by npm, but I come across some problems.
executed command:
[dinghao#localhost ~]$ sudo npm install -g less
error log:
npm http GET https://registry.npm.taobao.org/less
npm http GET https://registry.npm.taobao.org/less
npm http GET https://registry.npm.taobao.org/less
npm ERR! Error: failed to fetch from registry: less
npm ERR! at RegClient.<anonymous> (/usr/lib/node_modules/npm-registry-client/lib/get.js:140:18)
npm ERR! at cb (/usr/lib/node_modules/npm-registry-client/lib/request.js:32:9)
npm ERR! at RegClient.<anonymous> (/usr/lib/node_modules/npm-registry-client/lib/request.js:122:10)
npm ERR! at cb (/usr/lib/node_modules/npm-registry-client/lib/request.js:132:9)
npm ERR! at RegClient.<anonymous> (/usr/lib/node_modules/npm-registry-client/lib/request.js:225:20)
npm ERR! at Request._callback (/usr/lib/node_modules/npm-registry-client/lib/request.js:204:20)
npm ERR! at self.callback (/usr/lib/node_modules/request/index.js:148:22)
npm ERR! at Request.emit (events.js:117:20)
npm ERR! at ClientRequest.self.clientErrorHandler (/usr/lib/node_modules/request/index.js:257:10)
npm ERR! at ClientRequest.emit (events.js:95:17)
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-504.el6.x86_64
npm ERR! command "node" "/usr/bin/npm" "install" "-g" "less"
npm ERR! cwd /home/dinghao
npm ERR! node -v v0.10.36
npm ERR! npm -v 1.3.6
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/dinghao/npm-debug.log
npm ERR! not ok code 0
How to resolve this?

Error updating nodejs using npm

I read many posts here teaching how to update nodejs by using npm. I followed all the proposed steps by I keep getting the same error:
administrator#Ubuntu-CPDiX-Test-Machine:~$ npm install -g npm
npm http GET https://registry.npmjs.org/npm
npm ERR! Error: failed to fetch from registry: npm
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/administrator/npm-debug.log npm
npm ERR!
npm ERR! System Linux 3.13.0-32-generic
npm ERR! command "node" "/usr/bin/npm" "install" "-g" "npm"
npm ERR! cwd /home/administrator
npm ERR! node -v v0.6.12
npm ERR! npm -v 1.1.4
npm ERR! message failed to fetch from registry: npm
npm ERR! Error: EACCES, permission denied 'npm-debug.log'
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR!
npm ERR! System Linux 3.13.0-32-generic
npm ERR! command "node" "/usr/bin/npm" "install" "-g" "npm"
npm ERR! cwd /home/administrator
npm ERR! node -v v0.6.12
npm ERR! npm -v 1.1.4
npm ERR! path npm-debug.log
npm ERR! code EACCES
npm ERR! message EACCES, permission denied 'npm-debug.log'
npm ERR! errno {}
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/administrator/npm-debug.log
npm not ok
I get this error when I work in a virtual machine: a VMWare Ubuntu 12.04.5. Would you have any suggestions?
Thanks in advance!
Read the error:
Please try running this command again as root/Administrator
Try:
sudo npm install -g npm
And as #mscdex said, you have to upgrade you node version. it is really old.

Protractor install issues. SSL error, Behind Corp firewall

I have set http and https proxy, I am behind a corporate firewall, I am trying to install protractor and I am running into the below error, please help in solving this.
C:\nodejs>npm install protractor
npm ERR! Error: 7156:error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown
protocol:openssl\ssl\s23_clnt.c:795:
npm ERR!
npm ERR! at SlabBuffer.use (tls.js:235:18)
npm ERR! at CleartextStream.read [as _read] (tls.js:455:29)
npm ERR! at CleartextStream.Readable.read (_stream_readable.js:341:10)
npm ERR! at EncryptedStream.write [as _write] (tls.js:369:25)
npm ERR! at doWrite (_stream_writable.js:226:10)
npm ERR! at writeOrBuffer (_stream_writable.js:216:5)
npm ERR! at EncryptedStream.Writable.write (_stream_writable.js:183:11)
npm ERR! at write (_stream_readable.js:602:24)
npm ERR! at flow (_stream_readable.js:611:7)
npm ERR! at Socket.pipeOnReadable (_stream_readable.js:643:5)
npm ERR! If you need help, you may report this *entire* log,
npm ERR! including the npm and node versions, at:
npm ERR! <http://github.com/npm/npm/issues>
npm ERR! System Windows_NT 6.1.7601
npm ERR! command "C:\\nodejs\\\\node.exe" "C:\\nodejs\\node_modules\\npm\\bin\\n
pm-cli.js" "install" "protractor"
npm ERR! cwd C:\nodejs
npm ERR! node -v v0.10.34
npm ERR! npm -v 1.4.28
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! C:\nodejs\npm-debug.log
npm ERR! not ok code 0
C:\nodejs>

Error install grunt-cli using npm

I am getting the following error when installing grunt using npm nodejs. Can someone tell what it is trying have problems with and how I can fix it. We do have firewall so is there another way to download grunt and install? I a newbie and just getting my feet wet.
Your environment has been set up for using Node.js 0.10.26 (x64) and npm.
C:\Users\testuser>npm install -g grunt-cli
npm http GET https://registry.npmjs.org/grunt-cli
npm http GET https://registry.npmjs.org/grunt-cli
npm http GET https://registry.npmjs.org/grunt-cli
npm ERR! Error: 12812:error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown
protocol:openssl\ssl\s23_clnt.c:766:
npm ERR!
npm ERR! at SlabBuffer.use (tls.js:232:18)
npm ERR! at CleartextStream.read [as _read] (tls.js:452:29)
npm ERR! at CleartextStream.Readable.read (_stream_readable.js:320:10)
npm ERR! at EncryptedStream.write [as _write] (tls.js:366:25)
npm ERR! at doWrite (_stream_writable.js:226:10)
npm ERR! at writeOrBuffer (_stream_writable.js:216:5)
npm ERR! at EncryptedStream.Writable.write (_stream_writable.js:183:11)
npm ERR! at write (_stream_readable.js:583:24)
npm ERR! at flow (_stream_readable.js:592:7)
npm ERR! at Socket.pipeOnReadable (_stream_readable.js:624:5)
npm ERR! If you need help, you may report this *entire* log,
npm ERR! including the npm and node versions, at:
npm ERR! <http://github.com/npm/npm/issues>
npm ERR! System Windows_NT 6.2.9200
npm ERR! command "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nod
ejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "grunt-cli"
npm ERR! cwd C:\Users\testuser
npm ERR! node -v v0.10.26
npm ERR! npm -v 1.4.3
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! C:\Users\testuser\npm-debug.log
npm ERR! not ok code 0
thank you
Nick

Resources