使用:
- 节点12.9.0
- npm 6.10.2
- macOS莫哈韦
我正在学习一个在线教程,该教程教初学者如何通过发出-g
标志来全局安装npm模块:
myapp$ npm i [email protected] -g
字符串
输出量:
(node:26645) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 drain listeners added to [TLSSocket]. Use emitter.setMaxListeners() to increase limit
(node:26645) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 drain listeners added to [TLSSocket]. Use emitter.setMaxListeners() to increase limit
(node:26645) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 drain listeners added to [TLSSocket]. Use emitter.setMaxListeners() to increase limit
(node:26645) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 drain listeners added to [TLSSocket]. Use emitter.setMaxListeners() to increase limit
(node:26645) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 drain listeners added to [TLSSocket]. Use emitter.setMaxListeners() to increase limit
(node:26645) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 drain listeners added to [TLSSocket]. Use emitter.setMaxListeners() to increase limit
(node:26645) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 drain listeners added to [TLSSocket]. Use emitter.setMaxListeners() to increase limit
(node:26645) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 drain listeners added to [TLSSocket]. Use emitter.setMaxListeners() to increase limit
(node:26645) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 drain listeners added to [TLSSocket]. Use emitter.setMaxListeners() to increase limit
(node:26645) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 drain listeners added to [TLSSocket]. Use emitter.setMaxListeners() to increase limit
/usr/local/bin/nodemon -> /usr/local/lib/node_modules/nodemon/bin/nodemon.js
> [email protected] install /usr/local/lib/node_modules/nodemon/node_modules/fsevents
> node install
node-pre-gyp WARN Using needle for node-pre-gyp https download
[fsevents] Success: "/usr/local/lib/node_modules/nodemon/node_modules/fsevents/lib/binding/Release/node-v72-darwin-x64/fse.node" is installed via remote
> [email protected] postinstall /usr/local/lib/node_modules/nodemon
> node bin/postinstall || exit 0
Love nodemon? You can now support the project via the open collective:
> https://opencollective.com/nodemon/donate
+ [email protected]
added 289 packages from 144 contributors in 13.382s
型
我是Node.js新手,如何修复/关闭此警告?
我是否必须在所有需要全局安装模块的node.js项目文件中使用Use emitter.setMaxListeners()
?
这也是我使用sudo时的警告:sudo npm i [[email protected]](https://stackoverflow.com/cdn-cgi/l/email-protection) -g
个
2条答案
按热度按时间qlckcl4x1#
我也有这个问题。这是一个bug,似乎在v12.9.1中得到了修复。更新对我来说很有用。
e4yzc0pl2#
在我的场景中,遇到的问题源于网络相关的更改。在过去的两天里,网络基础设施进行了升级,导致官方NPM映像地址
https://registry.npmjs.org/
不可用。执行npm install
时,出现警告:字符串
此警告在一定时间后会出现错误:
型
要解决此问题,请考虑切换到中国大陆内的备用图像源,例如:
型
仅供参考