Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

npm install is extremely slow

Tags:

node.js

npm

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"
}

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

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

like image 250
CrazySynthax Avatar asked Oct 20 '25 20:10

CrazySynthax


1 Answers

My suggestion:

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

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

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

  • You can also try to check your connection and connect directly instead of 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
like image 142
Akintunde Avatar answered Oct 22 '25 11:10

Akintunde