0

I've wasted four hours now trying to install all dependencies of my 'keystonejs` project in production.

npm just hangs and then I get this message:

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

This is my `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"
}

UPDATE: I'm using node 5.7 and npm 3.6

danielrvt
  • 8,650
  • 14
  • 65
  • 110

1 Answers1

0

You need more memory on your server for npm. Simply add some as explained at https://stackoverflow.com/a/17173973/124416:

sudo /bin/dd if=/dev/zero of=/var/swap.1 bs=1M count=1024
sudo /sbin/mkswap /var/swap.1
sudo /sbin/swapon /var/swap.1
Community
  • 1
  • 1
w00t
  • 16,732
  • 6
  • 47
  • 55