npm 安装非常慢 [英] npm install is extremely slow

查看:76
本文介绍了npm 安装非常慢的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有以下 package.json 文件:

I have the following package.json file:

{
  "name": "trainologic",
  "version": "1.0.0",
  "description": "",
  "main": "main.js",
  "dependencies": {
    "child_process": "^1.0.2",
    "http-server": "^0.9.0",
    "open": "0.0.5"
  },
  "devDependencies": {

  },
  "scripts": {
    "start": "node main.js"
  },
  "author": "",
  "license": "ISC"
}

当我执行npm install"时,下载 3 个依赖项需要很长时间.

When I do "npm install" it takes very-very long time to download 3 dependencies.

我的操作系统是 Ubuntu 16,我的节点版本是 v4.2.6.

My OS is Ubuntu 16, and my node version is v4.2.6.

推荐答案

我的建议:

  • 通过尝试下面的这个命令来重新设置您的注册表

  • Re-set your registry by trying out this command below

npm 配置设置注册表 http://registry.npmjs.org/--global

这是因为您的连接可能存在 npm https 连接问题.这可能是通过代理连接的结果.

This is because your connection might have issues with npm https connection. this could be as a result of connecting via a proxy.

  • 您也可以尝试检查您的连接并直接连接,而不是通过代理.

注意:解决代理问题后,我建议您切换回安全的注册表

NOTE: After settling the proxy issue, I advise you switch back to a secured registry

npm config set registry https://registry.npmjs.org/ --global

这篇关于npm 安装非常慢的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆