【发布时间】:2016-06-23 03:42:52
【问题描述】:
我现在已经浪费了四个小时试图在生产环境中安装我的“keystonejs”项目的所有依赖项。
npm 只是挂起,然后我收到此消息:
<--- Last few GCs --->
859221 ms: Scavenge 116.4 (156.1) -> 115.5 (156.1) MB, 164.5 / 0 ms (+ 1116.0 ms in 14 steps since last GC) [allocation failure].
1003590 ms: Scavenge 116.5 (156.1) -> 115.6 (156.1) MB, 15.8 / 15 ms (+ 1588.7 ms in 14 steps since last GC) [allocation failure].
1003797 ms: Scavenge 116.5 (156.1) -> 115.6 (156.1) MB, 0.5 / 0 ms (+ 1.0 ms in 14 steps since last GC) [allocation failure].
<--- JS stacktrace --->
==== JS stack trace =========================================
Security context: 0x3fb4b37e3ac1 <JS Object>
1: baseClone(aka baseClone) [/usr/local/lib/node_modules/npm/node_modules/lodash.clonedeep/index.js:~253] [pc=0xbd65c4932f9] (this=0x3fb4b3704189 <undefined>,value=0x35b70929ee81 <an Object with map 0x16ee5e917979>,isDeep=0x3fb4b3704231 <true>,customizer=0x3fb4b3704189 <undefined>,key=0,object=0x35b70928f3d1 <JS Array[8]>,stack=0x1c3082095b39 <a Stack with map 0x3ad6ac90daa9>)
2: /* ano...
FATAL ERROR: Committing semi space failed. Allocation failed - process out of memory
这是我的`package.json`
{
"name": "mysite",
"version": "0.0.0",
"private": true,
"dependencies": {
"keystone": "^0.3.16",
"async": "^1.5.0",
"underscore": "^1.8.3",
"node-sass": "^3.3.2",
"node-sass-middleware": "^0.9.7",
"dotenv": "^1.1.0"
},
"devDependencies": {
"grunt": "^0.4.4",
"grunt-express-server": "^0.4.17",
"grunt-contrib-watch": "^0.6.1",
"grunt-contrib-jshint": "^0.7.1",
"jshint-stylish": "^2.0.1",
"load-grunt-tasks": "^0.4.0",
"load-grunt-configs": "^0.4.1",
"grunt-node-inspector": "^0.4.1",
"time-grunt": "^0.3.1",
"grunt-concurrent": "^0.5.0",
"grunt-nodemon": "^0.2.1",
"grunt-sass": "^1.0.0",
"open": "0.0.5"
},
"engines": {
"node": ">=0.10.22",
"npm": ">=1.3.14"
},
"scripts": {
"start": "node keystone.js"
},
"main": "keystone.js"
}
更新:我使用的是节点 5.7 和 npm 3.6
【问题讨论】:
-
你的 npm 版本是多少?
-
npm 3.6.0.这发生在亚马逊 t2.micro 实例中
-
我在看这个建议更新到 npm 3,但你已经在运行它。也许 npm 实际上没有足够的内存? Keystone 安装了大量的东西 iirc github.com/twbs/bootstrap/issues/19070
-
有没有什么方法可以在没有npm的情况下下载所有依赖项,然后用npm安装它们?
标签: node.js npm keystonejs