@reintroducing wrote:
What I Wanted to Do
I’ve written a CLI (similar to create-react-app) that takes care of some React project boilerplate for you. Part of the setup process is an npm install of
peerDependencies
. When you do this during setup, the install fails with the dreadednpm ERR! Maximum call stack size exceeded
which I’ve googled for hours with random work arounds working for some and not others and sometimes reproducible and sometimes not.My expectation is that the npm install of the peer deps would work and the setup would finish.
What Happened Instead
Every time I run the setup process of the CLI from scratch it fails on the peer dependencies install step.
Reproduction Steps
Here is the CLI with details on how to get up and running (just a few steps): https://github.com/spothero/ace/wiki/Initial-Setup
If you run that in a clean directory and say “Yes” to install peer deps setup step you will get the error. The offending step is this command:
npm install -S babel-polyfill@6.26.0 core-js@2.5.7 prop-types@15.6.2 react@16.2.0 react-dom@16.2.0
. Running that manually after the setup fails produces the same error.I thought maybe version numbers were wonky so i tried to strip them out running this next:
npm install -S babel-polyfill core-js prop-types react react-dom
. Result: also fails.So then I try just
npm i lodash
. Also fails.For fun I run this next:
npm install -S lodash request chalk express async
and it succeeds!I re-run the original offending command again:
npm install -S babel-polyfill@6.26.0 core-js@2.5.7 prop-types@15.6.2 react@16.2.0 react-dom@16.2.0
and it succeeds!For fun, I re-run the setup step for the CLI:
./node_modules/.bin/ace -- setup
and say “Yes” to install peer deps again. everything works as expected and I’m able to get through the setup process just fine.Details
If you want to repeat this every time, clear out all the files from the project directory and leave just the
package.json
file. Run through the setup steps again starting with the install step (npm install @spothero/ace -D
). Then run the setup again./node_modules/.bin/ace -- setup
and you’re back in the vicious cycle stated above in the reproduction steps section. (better yet, right after this setup step fails, run justnpm i lodash
and it fails too).Its not until I run the
npm install -S lodash request chalk express async
command that everything starts to work again. I have no clue why that is but hopefully it helps you guys with troubleshooting this (some of those packages are not even part of the CLI deps, lodash is, the others arent, at least directly). Then run the originalnpm install -S babel-polyfill@6.26.0 core-js@2.5.7 prop-types@15.6.2 react@16.2.0 react-dom@16.2.0
again and voila, working.This is reproducible on multiple systems with my co-workers so its not just my machine. I’m also installing node through nvm for what its worth.
Platform Info
$ npm --versions { '10.9-ace': '1.0.0', npm: '6.2.0', ares: '1.14.0', cldr: '33.1', http_parser: '2.8.0', icu: '62.1', modules: '64', napi: '3', nghttp2: '1.32.0', node: '10.9.0', openssl: '1.1.0i', tz: '2018e', unicode: '11.0', uv: '1.22.0', v8: '6.8.275.24-node.14', zlib: '1.2.11' } $ node -p process.platform darwin
Posts: 24
Participants: 13