Update on macOS failed upgrade

I had been using particle-cli for about two years now. I finally got enough network bandwidth to upgrade today and following the upgrade command npm install -g particle-cli it won’t work anymore. what should I do?

Using npm to install particle-cli is deprecated since it uses a global npm instance and fails to download certain dependencies.

First, uninstall particle-cli:

npm uninstall -g particle-cli

And then try using the installer script:

bash <( curl -sL https://particle.io/install-cli )

https://docs.particle.io/tutorials/developer-tools/cli/

1 Like

I tried uninstalling it and got
Harleys-MacBook-Pro:~ harleyfrazee$ npm uninstall particle-cli
npm WARN saveError ENOENT: no such file or directory, open ‘/Users/harleyfrazee/package.json’
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN enoent ENOENT: no such file or directory, open ‘/Users/harleyfrazee/package.json’
npm WARN harleyfrazee No description
npm WARN harleyfrazee No repository field.
npm WARN harleyfrazee No README data
npm WARN harleyfrazee No license field

so I tried with sudo and got

Harleys-MacBook-Pro:~ harleyfrazee$ sudo npm uninstall particle-cli
npm WARN saveError ENOENT: no such file or directory, open ‘/Users/harleyfrazee/package.json’
npm WARN enoent ENOENT: no such file or directory, open ‘/Users/harleyfrazee/package.json’
npm WARN harleyfrazee No description
npm WARN harleyfrazee No repository field.
npm WARN harleyfrazee No README data
npm WARN harleyfrazee No license field

so I did an sudo npm uninstall particle-cli and got

Harleys-MacBook-Pro:~ harleyfrazee$ sudo npm uninstall -g particle-cli
npm WARN deprecated undefined@0.1.0: this package has been deprecated
added 1 package from 1 contributor in 3.166s

Where do I go from here? I can’t uninstall or install

If you run the particle command is it still installed?

Next, could you try running the installation script?

Yes, it’s installed. It can run login, but it can’t access the USB - no permissions

You likely haven’t installed the new version. If npm is being temperamental you could try to force an uninstall with:

sudo npm uninstall -g --unsafe-perm particle-cli

You could also directly remove the executable from your PATH:

sudo rm -i "$(which particle)"

Lastly, use the installer script to download the new particle-cli. This will take care of the USB dependencies:

bash <( curl -sL https://particle.io/install-cli )

I’m still struggling. I did remove particle using the sudo rm -i “$(which particle)”

Now, when I run bash <( curl -sL https://particle.io/install-cli )

I get

Installing the Particle CLI to /Users/harleyfrazee/bin/particle
/dev/fd/63: line 68: /Users/harleyfrazee/bin/particle: Permission denied
chmod: /Users/harleyfrazee/bin/particle: No such file or directory
/dev/fd/63: line 106: /Users/harleyfrazee/bin/particle: No such file or directory

That looks like a permissions issue.

Can you verify that the bin directory exists and check its permissions?

ls -la ~/bin

Next, can you give yourself ownership of the bin directory?

sudo chown $USER ~/bin

After that, could you try running the installer script again?

Thanks so much for handing in there with me. I really do appreciate it. I think I have it installed, but not configured correctly. I can do a “particle login” and it appears to succeed. but when I try a “particle setup” I get:

Harleys-MacBook-Pro:~ harleyfrazee$ particle setup
 _ __             _   _      _        
| '_ \  __ _ _ __| |_(_) ___| | ___ 
| |_) |/ _` | '__| __| |/ __| |/ _ \
|  __/| (_| | |  | |_| | (__| |  __/
|_|    \__,_|_|   \__|_|\___|_|\___|
                 https://particle.io

> Setup is easy! Let's get started...
> It appears as though you are already logged in as harleyfrazee@hotmail.com
? Would you like to use this account? Yes
! The `serialport` dependency is missing or invalid.