npm install不安装嵌套的依赖项

时间:2016-04-08 16:02:49

标签: npm ubuntu-14.04 dependency-management

npm install无法安装所有嵌套的依赖项(看似深度超过2个包)。 我怀疑它可能与一个或多个依赖项(例如bcrypt)有关,安装时会出现错误并终止npm进程(尽管它们似乎已经成功安装)。

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

$ npm -v 12年2月14日

在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似乎顺利进行。不确定内存耗尽是不是问题。希望不会报告,但如果它再次破裂就会做。

1 个答案:

答案 0 :(得分:0)

我很确定这是内存耗尽的问题。下次遇到此问题时,会使用egrep -i -r 'killed process' /var/log/Finding which process was killed by Linux OOM killer)来查看OOM杀手是否杀死了npm install启动的某些进程。