npm ERR code ENOTFOUND npm ERR errno ENOTFOUND
电脑一段时间没有使用npm了,拉取项目安装依赖npm install
的时候报错
npm ERR! code ENOTFOUND
npm ERR! errno ENOTFOUND
npm ERR! network request to http://registry.cnpmjs.org/@tokenizer%2ftoken failed, reason: getaddrinfo ENOTFOUND registry.cnpmjs.org
npm ERR! network This is a problem 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 config list //查看配置
//主要查看这一项 registry = "https://registry.npm.taobao.org/"
// 如果你的是 registry = "http://registry.cnpmjs.org/"
//可以尝试用cnpm install
//当然可以换镜像 如下:
npm config set registry https://registry.npm.taobao.org
//再次npm install
//还有问题的话 可以是镜像没有安装
npm install -g cnpm --registry=https://registry.npm.taobao.org
//再次试试