【问题标题】:React boilerplate : Maximum call stack size exceeded反应样板:超过最大调用堆栈大小
【发布时间】:2019-02-05 10:19:21
【问题描述】:

我正在尝试创建react-boilerplate,但出现以下错误。

npm ERR! Maximum call stack size exceeded

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/dev1/.npm/_logs/2019-02-05T10_12_55_340Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! react-boilerplate@3.7.0 presetup: `npm i chalk shelljs`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the react-boilerplate@3.7.0 presetup script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/dev1/.npm/_logs/2019-02-05T10_12_55_434Z-debug.log

节点版本:v8.9.4

我已从 git 克隆设置并运行 npm run setup 命令,但出现此错误。

注意: remove node_modues and re-install node_modules - 不工作 uninstall node globaly and re-install node - 不工作

谁能帮忙?

【问题讨论】:

    标签: node.js reactjs react-boilerplate


    【解决方案1】:

    我检查了 npm 日志,发现安装失败 @xtuc/ieee754 我找到了这个解决方案https://github.com/angular/angular-cli/issues/12231

    您可能必须删除您的 ~/.npmrc 文件。

    我试过了,它为我解决了这个问题。

    希望这会有所帮助!

    这个问题只浪费了我 6 个小时 :(

    【讨论】:

      【解决方案2】:

      我花了几个小时解决了这个问题。以下解决方案对我有用

      rm -rf node_modules
      
      npm cache clean --f
      
      npm install
      

      【讨论】:

        【解决方案3】:

        在这种情况下,您需要手动/显式分配调用堆栈,以便增加调用堆栈大小以执行该操作。你可以试试:

        node --stack-size=16000 <file>
        

        由于您正在执行npm run setup,因此您需要基本上更改package.jsonsetup 脚本中的调用堆栈值,例如:

        "scripts": {
          "setup": "node --stack-size=16000 index.js"
        }
        

        如果这仍然导致堆栈大小错误,请尝试使用比16000 更大的值

        【讨论】:

        • 谢谢@Ankit Agrawal,现在我收到了Not Found: @xtuc/ieee754@https://registry.npmjs.org/@xtuc/ieee754/-/ieee754-1.2.0.tgz 我已经搜索了这个错误,但没有找到任何解决方案......你能提供更多帮助吗?
        • 试试npm rebuild
        • 在“重建”之后我得到了同样的错误Maximum call stack size exceeded。 :(
        • 如果我运行npm run setup 得到Not Found: @xtuc/ieee754@https://registry... 错误,如果我运行npm start 得到Maximum call stack... 错误..
        猜你喜欢
        • 2017-02-04
        • 2017-10-12
        • 1970-01-01
        • 1970-01-01
        • 2017-05-04
        • 2020-01-05
        • 2020-08-10
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多