2016年5月22日 星期日

Error: failed to fetch from registry: debug

http://stackoverflow.com/questions/12913141/message-failed-to-fetch-from-registry-while-trying-to-install-any-module

Error: failed to fetch from registry: debug


sudo apt-get purge nodejs npm
curl -sL https://deb.nodesource.com/setup | sudo bash -
sudo apt-get install -y nodejs

sudo: unable to resolve host

https://blog.longwin.com.tw/2008/11/linux-sudo-unable-to-resolve-host-2008/



/etc/hosts 原始內容

##################################################################################################################################################################

127.0.0.1       localhost
# The following lines are desirable for IPv6 capable hosts
::1     localhost ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts
##################################################################################################################################################################
127.0.0.1       localhost dev
# 或 改成下面這兩行
#127.0.0.1       localhost
#127.0.0.1       dev
# The following lines are desirable for IPv6 capable hosts
::1     localhost ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts

check show used port linux


sudo lsof -i
sudo netstat -lptu
sudo netstat -tulpn



ps -fp 1289
sudo netstat -plnt | grep ':80'