Error updating nodejs using npm - node.js

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.

Related

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 while installing Bower

I am trying to install bower but this gives me below error , which i am not able to decipher why , can someone share their experience or reason for the same
`home#home:/usr/local/share$ which npm
/usr/bin/npm
home#home:/usr/local/share$ which node
/usr/bin/node
home#home:/usr/local/share$ pwd
/usr/local/share
home#home:/usr/local/share$ cd npm
bash: cd: npm: No such file or directory
home#home:/usr/local/share$ sudo npm install -g bower
npm http GET https://registry.npmjs.org/bower
npm ERR! Error: failed to fetch from registry: bower
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 /usr/local/share/npm-debug.log npm
npm ERR!
npm ERR! System Linux 3.2.0-96-generic-pae
npm ERR! command "node" "/usr/bin/npm" "install" "-g" "bower"
npm ERR! cwd /usr/local/share
npm ERR! node -v v0.6.12
npm ERR! npm -v 1.1.4
npm ERR! message failed to fetch from registry: bower
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /usr/local/share/npm-debug.log
npm not ok

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.

nodejs npm install socket.io error

I new node.js developer. I trying simple chat project. So I want install socket.io with NPM but I get this error.
I use ubuntu 12.04
ubuntu#Ubuntu-1210:~/Masaüstü/blog$ npm install socket.io
npm http GET https://registry.npmjs.org/socket.io
npm ERR! Error: failed to fetch from registry: socket.io
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/ubuntu/Masaüstü/blog/npm-debug.log npm
npm ERR!
npm ERR! System Linux 3.8.0-35-generic
npm ERR! command "node" "/usr/bin/npm" "install" "socket.io"
npm ERR! cwd /home/ubuntu/Masaüstü/blog
npm ERR! node -v v0.6.12
npm ERR! npm -v 1.1.4
npm ERR! message failed to fetch from registry: socket.io
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/ubuntu/Masaüstü/blog/npm-debug.log
npm not ok
Sorry bad english. Thank you.
Like the answer in the link I posted in the comment above, I'd suggest first running
npm config set registry https://registry.npmjs.org/
Recomend use sudo.
sudo npm install socket.io

I'm trying to install node-gyp node packages through npm, but it not working

I am getting following error when running npm install -g node-gyp command on Ubuntu and Windows 7
ERROR:
` sudo npm install -g node-gyp
npm http GET https://registry.npmjs.org/node-gyp
npm ERR! Error: failed to fetch from registry: node-gyp
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/gurbani/npm-debug.log npm
npm ERR!
npm ERR! System Linux 3.2.0-23-generic-pae
npm ERR! command "node" "/usr/bin/npm" "install" "-g" "node-gyp"
npm ERR! cwd /home/gurbani
npm ERR! node -v v0.6.12
npm ERR! npm -v 1.1.4
npm ERR! message failed to fetch from registry: node-gyp
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/gurbani/npm-debug.log
npm not ok`
Please help in resolving this issue.
Thanks in advance.
Try sudo apt-get install gcc
then update all packages

Resources