[ISSUE] SerialPort.list is not a function

I reinstalled particle-cli in an attempt to fix path issues in MacOS Monterey and now I’m in a world of trouble:

  • If I install particle-cli using the recommended method (straight from particle using curl), the particle command is found but produces no output in terminal.
  • If I install particle-cli using npm install -g particle-cli I get output, but none of the serial commands work: they all output SerialPort.list is not a function.

I uninstalled and reinstalled through every path mentioned here (including running sudo npm install -g --unsafe-perm particle-cli and running from source) to no avail.

Thank you for your help!

Are you on one of the newer ARM macs? If so, you’re probably running into this issue:

I’ll note that I’m currently struggling with the same issue installing on a fresh Ubuntu machine (18.04.3 LTS). I’ve gotten everything to work in the past on an identical machine so I’m wondering if there’s some version mismatch somewhere.

Does it work if you try the particle-cli managed by neopo?

On Arch Linux the serial commands still work for me:

$ neopo particle serial list

I’m using version 3.1.0 by the way:

$ particle --version

the neopo version (neopo particle serial list) works for me! I suppose I could change all my scripts over to just use neopo, no skin off my back, personally. Happy to help debug the normal particle install however I can for the sake of other folk though.

My particle version is the same, 3.1.0

EDIT: looks like installing neopo also fixed this issue when running the particle cli directly! Any idea what the difference in install approach might be to cause one to work but not the other?

EDIT2: could it be particle usb configure that is fixing something? I notice you do that in the neopo install script but that was not something I’ve ever ran to my knowledge

This is mostly because running particle will still give you the neopo wrapper, which applies some fixes to the environment particle-cli runs as a subprocess in.

This only copies the udev rules file on Linux to allow non-root access to Particle devices over serial/DFU.

1 Like

Got it - I’ll just continue to use neopo then! Thanks for your work on that project :slight_smile:

1 Like

I’ll also note separately as someone who has an M1 mac on Monterrey that the particle cli as installed by workbench worked perfectly for me - I think it properly contextualizes it in rosetta mode when it runs that way? Either way I’d recommend trying to install via workbench if you haven’t tried that and neopo doesn’t work for you @maximiliaan or if for whatever reason you don’t want to go that route.