Skip to content
This repository has been archived by the owner on Feb 18, 2021. It is now read-only.

Maximum call stack size error #94

Open
fiznool opened this issue Nov 10, 2015 · 3 comments
Open

Maximum call stack size error #94

fiznool opened this issue Nov 10, 2015 · 3 comments

Comments

@fiznool
Copy link

fiznool commented Nov 10, 2015

npm-shrinkwrap
/home/fiznool/.nvm/versions/node/v4.2.2/lib/node_modules/npm-shrinkwrap/node_modules/npm/lib/ls.js:197
  Object.keys(deps).forEach(function (d) {
         ^

RangeError: Maximum call stack size exceeded
    at Array.forEach (native)
    at bfsify (/home/fiznool/.nvm/versions/node/v4.2.2/lib/node_modules/npm-shrinkwrap/node_modules/npm/lib/ls.js:197:21)
    at bfsify (/home/fiznool/.nvm/versions/node/v4.2.2/lib/node_modules/npm-shrinkwrap/node_modules/npm/lib/ls.js:217:10)
    at bfsify (/home/fiznool/.nvm/versions/node/v4.2.2/lib/node_modules/npm-shrinkwrap/node_modules/npm/lib/ls.js:217:10)
    at bfsify (/home/fiznool/.nvm/versions/node/v4.2.2/lib/node_modules/npm-shrinkwrap/node_modules/npm/lib/ls.js:217:10)
    at bfsify (/home/fiznool/.nvm/versions/node/v4.2.2/lib/node_modules/npm-shrinkwrap/node_modules/npm/lib/ls.js:217:10)
    at bfsify (/home/fiznool/.nvm/versions/node/v4.2.2/lib/node_modules/npm-shrinkwrap/node_modules/npm/lib/ls.js:217:10)
    at bfsify (/home/fiznool/.nvm/versions/node/v4.2.2/lib/node_modules/npm-shrinkwrap/node_modules/npm/lib/ls.js:217:10)
    at bfsify (/home/fiznool/.nvm/versions/node/v4.2.2/lib/node_modules/npm-shrinkwrap/node_modules/npm/lib/ls.js:217:10)
    at bfsify (/home/fiznool/.nvm/versions/node/v4.2.2/lib/node_modules/npm-shrinkwrap/node_modules/npm/lib/ls.js:217:10)

I admittedly have a large dependency graph, but a regular npm shrinkwrap handles it ok.

@martin-torhage
Copy link

I get the same error. Turns out that node's default stack size is only 984 kB (which seems low to me). By increasing it I got it to work. E.g: node --stack_size=10240

npm-shrinkwrap doesn't seem to pass arguments down to node. I don't know if this is something that can be changed in npm-shrinkwrap or if npm is blocking this. It doesn't seem like there is a way to configure node globally, so what you have to do is add a wrapper for node that calls the real node with the added stack_size argument.

$ cat bin/node
#!/bin/sh
/usr/local/opt/nvm/versions/node/v0.12.9/bin/node --stack_size=10240 $@

Is it possible to make npm-shrinkwrap pass v8 options to node?

@jscheid
Copy link

jscheid commented Jan 22, 2016

I'm getting the same error, this works for me:

$ node --stack_size=10240 $(which npm-shrinkwrap)

@fiznool
Copy link
Author

fiznool commented Jan 22, 2016

Thanks for this.

Maybe something could be added into the README for others who experience this issue?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants