Unhandled rejection RangeError: Maximum call stack size exceeded

What I Wanted to Do

npm install

What Happened Instead

Unhandled rejection RangeError: Maximum call stack size exceeded
at /usr/lib/node_modules/npm/node_modules/aproba/index.js:39:16
at Array.forEach ()
at validate (/usr/lib/node_modules/npm/node_modules/aproba/index.js:34:11)
at flatNameFromTree (/usr/lib/node_modules/npm/lib/install/flatten-tree.js:37:3)
at flatNameFromTree (/usr/lib/node_modules/npm/lib/install/flatten-tree.js:39:14)
at flatNameFromTree (/usr/lib/node_modules/npm/lib/install/flatten-tree.js:39:14)
at flatNameFromTree (/usr/lib/node_modules/npm/lib/install/flatten-tree.js:39:14)
at flatNameFromTree (/usr/lib/node_modules/npm/lib/install/flatten-tree.js:39:14)
at flatNameFromTree (/usr/lib/node_modules/npm/lib/install/flatten-tree.js:39:14)
at flatNameFromTree (/usr/lib/node_modules/npm/lib/install/flatten-tree.js:39:14)
at flatNameFromTree (/usr/lib/node_modules/npm/lib/install/flatten-tree.js:39:14)
at flatNameFromTree (/usr/lib/node_modules/npm/lib/install/flatten-tree.js:39:14)
at flatNameFromTree (/usr/lib/node_modules/npm/lib/install/flatten-tree.js:39:14)
at flatNameFromTree (/usr/lib/node_modules/npm/lib/install/flatten-tree.js:39:14)
at flatNameFromTree (/usr/lib/node_modules/npm/lib/install/flatten-tree.js:39:14)
at flatNameFromTree (/usr/lib/node_modules/npm/lib/install/flatten-tree.js:39:14)
npm ERR! cb() never called!

npm ERR! This is an error with npm itself. Please report this error at:
npm ERR! https://npm.community

npm ERR! A complete log of this run can be found in:
npm ERR! /home/installer/.npm/_logs/2019-05-24T08_12_40_961Z-debug.log
Script cd react && npm install handling the scripts event returned with error code 1
Script @scripts was called via post-update-cmd

Reproduction Steps

Not yet ready, as I need to trim the internal repo.

Details

Deploying a project in fresh Docker container.

0 info it worked if it ends with ok
1 verbose cli [ ‘/usr/bin/node’, ‘/usr/bin/npm’, ‘install’ ]
2 info using npm@6.9.0
3 info using node@v12.3.1
4 verbose npm-session d881b753890ebef3
5 silly install runPreinstallTopLevelLifecycles
6 silly preinstall pvg-react-power@0.0.0
7 info lifecycle pvg-react-power@0.0.0~preinstall: pvg-react-power@0.0.0
8 silly install loadCurrentTree
9 silly install readLocalPackageData
10 timing npm Completed in 298ms
11 error cb() never called!
12 error This is an error with npm itself. Please report this error at:
13 error https://npm.community

Platform Info

$ npm --versions
{
  npm: '6.9.0',
  ares: '1.15.0',
  brotli: '1.0.7',
  cldr: '35.1',
  http_parser: '2.8.0',
  icu: '64.2',
  llhttp: '1.1.3',
  modules: '72',
  napi: '4',
  nghttp2: '1.38.0',
  node: '12.3.1',
  openssl: '1.1.1b',
  tz: '2019a',
  unicode: '12.1',
  uv: '1.29.1',
  v8: '7.4.288.27-node.18',
  zlib: '1.2.11'
}

$ node -p process.platform
Usage: npm <command>

where <command> is one of:
    access, adduser, audit, bin, bugs, c, cache, ci, cit,
    clean-install, clean-install-test, completion, config,
    create, ddp, dedupe, deprecate, dist-tag, docs, doctor,
    edit, explore, get, help, help-search, hook, i, init,
    install, install-ci-test, install-test, it, link, list, ln,
    login, logout, ls, org, outdated, owner, pack, ping, prefix,
    profile, prune, publish, rb, rebuild, repo, restart, root,
    run, run-script, s, se, search, set, shrinkwrap, star,
    stars, start, stop, t, team, test, token, tst, un,
    uninstall, unpublish, unstar, up, update, v, version, view,
    whoami

npm <command> -h  quick help on <command>
npm -l            display full usage info
npm help <term>   search for help on <term>
npm help npm      involved overview

Specify configs in the ini-formatted file:
    /root/.npmrc
or on the command line via: npm <command> --key value
Config info can be viewed via: npm help config

npm@6.9.0 /usr/lib/node_modules/npm

The long thread with this error is: Always Reproducible "Maximum call stack size exceeded" npm install error

1 Like

Remove the node_modeules and package-lock.json from your project and re-npm install