5

i got this when running npm install

npm WARN deprecated ts-simple-ast@12.4.0: NOTICE: ts-simple-ast has been renamed to ts-morph and version reset to 1.0.0. Switch at your leisure...
npm WARN deprecated circular-json@0.5.9: CircularJSON is in maintenance only, flatted is its successor.
npm WARN deprecated nodemailer@2.7.2: All versions below 4.0.1 of Nodemailer are deprecated. See https://nodemailer.com/status/
npm WARN deprecated nomnom@1.5.2: Package no longer supported. Contact support@npmjs.com for more info.
npm WARN deprecated mailcomposer@4.0.1: This project is unmaintained
npm WARN deprecated socks@1.1.9: If using 2.x branch, please upgrade to at least 2.1.6 to avoid a serious bug with socket data flow and an
import issue introduced in 2.1.0
npm WARN deprecated uws@9.14.0: New code is available at github.com/uNetworking/uWebSockets.js
npm WARN deprecated node-uuid@1.4.8: Use uuid module instead
npm WARN deprecated buildmail@4.0.1: This project is unmaintained
npm ERR! Maximum call stack size exceeded
npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\1-PC\AppData\Roaming\npm-cache\_logs\2019-02-22T21_56_49_385Z-debug.log
sashoalm
  • 75,001
  • 122
  • 434
  • 781
Salma Ahmed
  • 61
  • 1
  • 1
  • 3
  • 1
    What npm install command are you running and where (which folder) are you running it in? What version of npm do you have? – DeborahK Feb 22 '19 at 22:08
  • Duplicate of https://stackoverflow.com/questions/40566348/maximum-call-stack-size-exceeded-on-npm-install – miles_b Feb 22 '19 at 22:16
  • @Salma Ahmed, please add more details. You can find guidelines on how to ask a good question on Stack Overflow here https://stackoverflow.com/help/how-to-ask – Sanjeev Feb 22 '19 at 23:15
  • please share package.json file and some details – paras shah Feb 23 '19 at 04:56

3 Answers3

4

Go to your project directory and remove node_modules folder,

rm -rf node_modules

Then clean your cache,

npm cache clean --f

Finally reinstall dependencies,

npm i

MonkeyScript
  • 4,776
  • 1
  • 11
  • 28
  • This is the best answer. 9 times out of 10, it was the `node_modules` folder causing the issue (and not even a cache clear helps). – Lance McCarthy May 15 '21 at 15:01
  • Yes remove the folder node_modules works, in my case the folder location is C:\Users\user1\AppData\Roaming\npm\node_modules – Dung Jan 07 '22 at 21:14
4

I used Docker to build a react project and got a similar error (although this error was not repeated locally). This error is returned due to nesting limitations of the recursive call.

As a workaround, the following command helped me, which increase the maximum number of recursive calls:

node --stack-size=2000 /local/lib/node_modules/npm/bin/npm-cli.js install

I found this solution on the Russian-language forum

  • 5
    This is a bit sorter w/o writing out the whole directory `node --stack-size=2000 $(which npm) install` – CTS_AE Apr 24 '20 at 11:37
  • 1
    @CTS_AE is a neater command. But don't forget to use backticks, or you'll get EOF error *node --stack-size=2000 \`$(which npm) install\` * – user2552108 Jun 14 '22 at 00:38
0

I faced this issue when I run the create-react-app command. Although the command is different the create react app scaffolding does run npm i command as well when triggered for installing various dependencies.

  • Delete the global .npmrc file located in C:/<name of the root folder>/nvm/v12.18.3/node_modules/npm
  • Run npm cache clean --force outside the project folder
  • Then again run the npm i inside the project folder that should fix the issue.

Code Editor: Visual Studio Code running in administrator mode.

Host operating system: Microsoft Windows 10.

Using NVM to run Node.js in Windows 10.

Shrivathsa
  • 91
  • 6