javascript – npm install上超出了最大调用堆栈大小

前端之家收集整理的这篇文章主要介绍了javascript – npm install上超出了最大调用堆栈大小前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我正在尝试运行npm install,这是从控制台输出的:
npm ERR! Linux 4.8.0-27-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install"
npm ERR! node v6.9.1
npm ERR! npm  v3.10.8

npm ERR! Maximum call stack size exceeded
npm ERR! 
npm ERR! If you need help,you may report this error at:
npm ERR!     <https://github.com/npm/npm/issues>

这是npm-debug.log的内容

113791 verbose stack RangeError: Maximum call stack size exceeded
113791 verbose stack     at Object.color (/usr/lib/node_modules/npm/node_modules/npmlog/node_modules/console-control-strings/index.js:115:32)
113791 verbose stack     at EventEmitter.log._format (/usr/lib/node_modules/npm/node_modules/npmlog/log.js:252:51)
113791 verbose stack     at EventEmitter.<anonymous> (/usr/lib/node_modules/npm/node_modules/npmlog/log.js:138:24)
113791 verbose stack     at emitThree (events.js:116:13)
113791 verbose stack     at emit (events.js:194:7)
113791 verbose stack     at .<anonymous> (/usr/lib/node_modules/npm/node_modules/npmlog/node_modules/are-we-there-yet/tracker-group.js:23:18)
113791 verbose stack     at emitThree (events.js:116:13)
113791 verbose stack     at emit (events.js:194:7)
113791 verbose stack     at .<anonymous> (/usr/lib/node_modules/npm/node_modules/npmlog/node_modules/are-we-there-yet/tracker-group.js:23:18)
113791 verbose stack     at emitThree (events.js:116:13)
113791 verbose stack     at emit (events.js:194:7)
113792 verbose cwd /home/giorgi/AdMove/dev/web-advertiser-admove
113793 error Linux 4.8.0-27-generic
113794 error argv "/usr/bin/nodejs" "/usr/bin/npm" "install"
113795 error node v6.9.1
113796 error npm  v3.10.8
113797 error Maximum call stack size exceeded
113798 error If you need help,you may report this error at:
113798 error     <https://github.com/npm/npm/issues>
113799 verbose exit [ 1,true ]

多次删除node_modules并尝试重新安装.无法理解造成这种情况的原因以及如何解决这个问题.

@R_403_323@

netzeilder的回答帮助我解决了这个问题.但是如果你运行命令npm cache clean,它会给你一条消息

As of npm@5,the npm cache self-heals from corruption issues and data extracted from the cache is guaranteed to be valid

因此,从npm5开始,您可以通过在命令中添加–force标志来实现.

所以命令是:

npm cache clean --force

猜你在找的JavaScript相关文章