npm install 不安装嵌套的依赖项

npm install does not install nested dependancies

npm install 无法安装所有嵌套的依赖项(似乎来自 2 个包的深度及以上)。 我怀疑它可能与一个或多个依赖项(例如 bcrypt)有关,这些依赖项在安装时出错并终止 npm 进程(尽管它们似乎安装成功)。

运行 npm install 再次没有安装所有依赖项,您必须手动调用 npm install <one of your packages>@<it's version number> 这是一件坏事。

$ npm -v 2.14.12

在 Mac OSX 上工作正常。问题出在 Ubuntu 14.04.4 LTS。

** 编辑 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"
  }
}

我已将服务器从 0.5 Gb RAM 升级到 2 Gb RAM,目前看来 npm install 进展顺利。不确定内存耗尽是问题所在。希望不会报告,但如果它再次中断,我会做的。

我相当确定这是 运行 内存不足的问题。下次我遇到这个问题时将使用 egrep -i -r 'killed process' /var/log/ ( Finding which process was killed by Linux OOM killer ) 来查看 OOM killer 是否杀死了 npm install 启动的一些进程。