0

npm install is failing to install all nested dependencies (seemingly from a depth of 2 packages deep and beyond). I suspected it might have something to do with one or more dependencies (e.g. bcrypt) which error on install and kill the npm process (despite themselves seeming to install successfully).

Running npm install again does not install all the dependencies and you have to manually invoke npm install <one of your packages>@<it's version number> which is a bad thing.

$ npm -v 2.14.12

Works fine on Mac OSX. Problem is on Ubuntu 14.04.4 LTS.

** Edit 1: package.json **

{
  "name": "test",
  "version": "0.0.0",
  "description": "Test",
  "main": "",
  "scripts": {
  },
  "author": "",
  "license": "ISC",
  "dependencies": {
    "bcrypt": "0.8.5",
    "boom": "^3.1.2",
    "deep-freeze": "0.0.1",
    "good": "~6.4.0",
    "good-console": "~5.2.0",
    "hapi": "~11.1.2",
    "hapi-auth-cookie": "^3.1.0",
    "inert": "~3.2.0",
    "iron": "^4.0.0",
    "joi": "^8.0.4",
    "jquery": "^2.1.1",
    "kerberos": "0.0.17",
    "lodash": "^3.10.1",
    "moment": "^2.11.2",
    "mysql": "^2.10.2",
    "q": "~1.4.1",
    "react": "0.14.6",
    "react-dom": "0.14.6",
    "react-redux": "4.0.6",
    "react-router": "2.0.0-rc5",
    "react-router-redux": "2.1.0",
    "reduce-reducers": "0.1.1",
    "redux": "^3.0.5",
    "request": "2.69.0",
    "sequelize": "git://github.com/ajamesphillips/sequelize.git",
    "sparkpost": "^1.2.0"
  }
}

I have upgraded the server from 0.5 Gb RAM to 2 Gb RAM and so far it seems npm install proceeds smoothly. Not certain that memory exhaustion was the problem. Will hopefully not report back but will do if it breaks again.

AJP
  • 26,547
  • 23
  • 88
  • 127
  • What is your `package.json`? You are probably right -- a failed binary build or a post-install script can possibly kill `npm install` process, or drop it into a strange state. Are you getting any errors in your log? – lxe Apr 09 '16 at 23:22
  • Thanks @lxe Have added `package.json`. Problem seems to be solved by moving to large instance. Not convinced yet though. Also weirdly often npm couldn't even produce a `npm-debug.log`. And when it could it just had the output from the npm install which a couple of times showed `kerberos`, `bcrypt` or something else hitting OOM – AJP Apr 10 '16 at 22:41

1 Answers1

0

I'm fairly certain this was an issue with running out of memory. Will use egrep -i -r 'killed process' /var/log/ ( Finding which process was killed by Linux OOM killer ) next time I have this problem to see if OOM killer killed some of the processes launched by npm install.

Community
  • 1
  • 1
AJP
  • 26,547
  • 23
  • 88
  • 127