繁体   English   中英

React 样板:超出最大调用堆栈大小

[英]React boilerplate : Maximum call stack size exceeded

我正在尝试创建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 remove node_modues and re-install node_modules uninstall node globaly and re-install node - 不起作用

任何人都可以帮忙吗?

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

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

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

希望这可以帮助!

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

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

rm -rf node_modules

npm cache clean --f

npm install

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

node --stack-size=16000 <file>

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

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

如果仍然出现堆栈大小错误,请尝试使用16000以外的更大值

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM