首页 > 解决方案 > 无法在 Ubuntu 16.04 上安装浏览同步

问题描述

我安装了 nodejs 和 npm。尝试使用命令安装 browser-sync npm install -g browser-sync但出现错误

    npm install -g browser-sync
npm ERR! Linux 4.15.0-101-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install" "-g" "browser-sync"
npm ERR! node v4.2.6
npm ERR! npm  v3.5.2
npm ERR! code ENOTFOUND
npm ERR! errno ENOTFOUND
npm ERR! syscall getaddrinfo
npm ERR! network getaddrinfo ENOTFOUND registry.npmjs.org registry.npmjs.org:443
npm ERR! network This is most likely not a problem with npm itself
npm ERR! network and is related to network connectivity.
npm ERR! network In most cases you are behind a proxy or have bad network settings.
npm ERR! network 
npm ERR! network If you are behind a proxy, please make sure that the
npm ERR! network 'proxy' config is set properly.  See: 'npm help config'
npm ERR! Please include the following file with any support request:
npm ERR!     /home/krishna/npm-debug.log`

无法弄清楚出了什么问题。高度赞赏帮助。

标签: javascriptnode.jsubuntunpmbrowser-sync

解决方案


看起来您遇到了连接问题。

尝试使用 ping 工具检查您的连接来检查您的连接:

ping google.com

您的问题可能有很多:代理、断开的电缆、dns。在 Ubuntu 上也可能是一个问题,要解决它值得尝试重新启动网络管理器

sudo service network-manager restart

推荐阅读