npm安装时超出了最大呼叫堆栈大小 [英] Maximum call stack size exceeded on npm install
问题描述
我正在尝试运行npm install
,这是从控制台输出的:
I'm trying to run npm install
, this is output from console:
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
,并尝试重新安装.无法理解导致此问题的原因以及解决方法.
Removed node_modules
several times and tried to reinstall. Can't understand what's the reason that causes this and how to fix it.
推荐答案
metzelder的答案帮助我解决了该问题.但是,如果您运行命令npm cache clean
,它将向您显示一条消息
metzelder's answer helped me fix the issue. however if you run the command npm cache clean
, it will give you a message
从npm @ 5开始,npm缓存会因损坏问题而自我修复,并且保证从缓存中提取的数据是有效的
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
标志来实现.
So, as of npm5 you can do by adding a --force
flag to the command.
所以命令是:
npm cache clean --force
这篇关于npm安装时超出了最大呼叫堆栈大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!