node 监听器数量警告:
MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 upgrade listeners added to [Server]. Use emitter.setMaxListeners() to increase limit
解决:
//nuxt项目在 nuxt.config.js中加入(vue在vue.config.js中加入)
require('events').EventEmitter.defaultMaxListeners = 0; // 解除监听器数量限制
或限定数值
require('events').EventEmitter.defaultMaxListeners = 100; // 监听器数量限制为100个