JamieMason / syncpack

Consistent dependency versions in large JavaScript Monorepos.
https://jamiemason.github.io/syncpack/
MIT License
1.44k stars 50 forks source link

fix(prompt): increase `EventEmitter`'s max listener count #155

Closed devunt closed 10 months ago

devunt commented 1 year ago

Description

MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 keypress listeners added to [ReadStream]. Use emitter.setMaxListeners() to increase limit warning when running syncpack prompt. This error makes syncpack prompt practically unusable.

CleanShot 2023-08-15 at 22 17 53@2x

My monorepo contains 11 packages for now, but it will be constantly increasing.

Suggested Solution

Add EventEmitter.setMaxListeners(Infinity) to command entrypoint.

JamieMason commented 1 year ago

Thanks @devunt, I've never seen this before – if you run syncpack list | nl how many dependencies does it show that you have please?

devunt commented 1 year ago

Not that many. It shows 116 packages are currently used.

JamieMason commented 1 year ago

hm yeah, not many. Thanks, I'll take a look. I'm going away tomorrow until next week though so this might be a while 👍🏻

JamieMason commented 1 year ago

Incase I need it, can you leave your syncpack, OS, and node versions etc?

devunt commented 1 year ago

pnpm dlx envinfo

  System:
    OS: macOS 13.4.1
    CPU: (8) arm64 Apple M1 Pro
    Memory: 815.38 MB / 32.00 GB
    Shell: 3.6.1 - /opt/homebrew/bin/fish
  Binaries:
    Node: 20.5.1 - /opt/homebrew/bin/node
    npm: 9.8.0 - /opt/homebrew/bin/npm
    pnpm: 8.6.12 - ~/Library/pnpm/pnpm
  Managers:
    Cargo: 1.70.0 - ~/.cargo/bin/cargo
    CocoaPods: 1.12.1 - /opt/homebrew/bin/pod
    Homebrew: 4.1.4 - /opt/homebrew/bin/brew
    pip3: 23.2.1 - /opt/homebrew/bin/pip3
    RubyGems: 3.0.3.1 - /usr/bin/gem
  Utilities:
    CMake: 3.27.2 - /opt/homebrew/bin/cmake
    Make: 3.81 - /usr/bin/make
    GCC: 14.0.3 - /usr/bin/gcc
    Git: 2.41.0 - /opt/homebrew/bin/git
    Clang: 14.0.3 - /usr/bin/clang
    Subversion: 1.14.2 - /opt/homebrew/bin/svn
    FFmpeg: 6.0 - /opt/homebrew/bin/ffmpeg
    Curl: 7.88.1 - /usr/bin/curl
  Servers:
    Apache: 2.4.56 - /usr/sbin/apachectl
  Virtualization:
    Docker: 24.0.5 - /usr/local/bin/docker
    Parallels: 18.3.2 - /usr/local/bin/prlctl
  SDKs:
    iOS SDK:
      Platforms: DriverKit 22.4, iOS 16.4, macOS 13.3, tvOS 16.4, watchOS 9.4
  IDEs:
    Android Studio: Chipmunk 2021.2.1 Patch 2 Chipmunk 2021.2.1 Patch 2
    VSCode: 1.81.1 - /opt/homebrew/bin/code
    Vim: 9.0 - /usr/bin/vim
    Xcode: 14.3.1/14E300c - /usr/bin/xcodebuild
  Languages:
    Bash: 3.2.57 - /bin/bash
    Go: 1.20.7 - /opt/homebrew/bin/go
    Perl: 5.30.3 - /usr/bin/perl
    Protoc: 23.4 - /opt/homebrew/bin/protoc
    Python3: 3.11.4 - /opt/homebrew/bin/python3
    Ruby: 2.6.10 - /usr/bin/ruby
    Rust: 1.70.0 - /Users/devunt/.cargo/bin/rustc
  Databases:
    SQLite: 3.39.5 - /usr/bin/sqlite3
  Browsers:
    Safari: 16.5.2

pnpm list

Legend: production dependency, optional only, dev only

@penxle/monorepo@0.0.1 /Users/devunt/workspace/penxle (PRIVATE)

devDependencies:
@penxle/eslint-config link:packages/eslint-config      lint-staged 14.0.0
@penxle/prettier-config link:packages/prettier-config  prettier 3.0.1
cspell 7.0.0                                           syncpack 11.2.1
eslint 8.47.0                                          turbo 1.10.12
gitmoji-cli 8.4.0                                      typescript 5.1.6
husky 8.0.3
devunt commented 1 year ago

Since it is a public repository, you may clone it and test it yourself if you need.

Repository: https://github.com/penxle/penxle Reproduction command: pnpm syncpack prompt --types prod,dev,local

JamieMason commented 1 year ago

Thanks, I think this is going to be something basic inside syncpack that affects everyone but we can see.

JamieMason commented 10 months ago

Hi @devunt, please try this with npm install -g syncpack@alpha and reopen this issue if the problem still stands, thanks a lot.