ISSUE - Particle CLI on mac BigSur- not installing

I recently migrated and older mac to a newer one running BigSur 11.5.1 (apple M1 chip) following macs process to migrate all files from old to new computer. I had Particle CLI in the old mac, and continued to work in the new one without issues (apparently). It seems the mac os migration process moved and installed all necessary files.

After running a few basic commands (particle serial wifi, etc) the CLI was asking me to update to the latest version, so I did following the instructions. Some errors appeared in the screen (sorry I did not catch that log) so I tried this command npm uninstall -g particle-cli".
Apparently, I did uninstall something.

then I run "bash <( curl -sL )" and it seems that nothing is installed. This is the log I get:

:::: Installing the Particle CLI for darwin to "/Users/fabioenriquez/bin/particle"
Traceback (most recent call last):
File "<string>", line 1, in <module>
KeyError: 'arm'
gunzip: (stdin): unexpected end of file
:::: Done!
:::: Installing dependencies
:::: Done!
:::: Success!
:::: The Particle CLI has been installed to: "/Users/fabioenriquez/bin"
:::: Your "/Users/fabioenriquez/.zprofile" file has been updated to properly set $PATH
:::: If you previously installed the CLI with npm, run "npm uninstall -g particle-cli"

node version is v.12.14.1 and npm is 6.13.4. I also updated homebrew to 3.2.6.

Appreciate your help

If you are using a MAC M1, you should have installed Rosetta, you need to activate this option from Terminal app.

Thanks @ismaelSB . I am not an expert on these things. I think I found some instructions about installing Rosetta from terminal and I got this:

% softwareupdate --install-rosetta
I have read and agree to the terms of the software license agreement. A list of Apple SLAs may be found here:
Type A and press return to agree: a

2021-08-12 13:20:16.952 softwareupdate[1309:31867] Package Authoring Error: 071-72767: Package reference is missing installKBytes attribute

Install of Rosetta 2 finished successfully

However, I still dont have any success with running commands on Particle CLI. Any more hints?
Thanks in advance

Are you running your terminal with Rosetta enabled?

Hi @nrobinson2000 . Thanks for the tip. I enabled the Rosetta for the Terminal but still I get nothing. The particle commands just go blank.
Screen Shot 2021-08-15 at 5.37.18 PM

Any specific procedure I can do to start fresh? I.e uninstall and re-install things.

Thanks again

Can you check how many “versions” of particle you have installed?

which -a particle

If the first result is not in /Users/fabioenriquez/bin, then you should try to uninstall particle-cli again:

npm uninstall -g particle-cli

This looks very similar to this post:

Hi @nrobinson2000. Apologies for the silence and thanks again for the support. This is what I get when I run the which command.
Screen Shot 2021-08-23 at 7.20.05 AM

However, I still get nothing when I issue a particle command.

I did see this post before and tried the suggestion. Again I get nothing. After running npm uninstall -g particle-cli, it seems that nothing is uninstalled.

It seems that I found the issue. It seems that after migrating to the new mac (M1 chip), the privileges for the appropriate folders were not set properly. Hence, the installation procedures for npm and particle-cli always issued some sort of “warning” or “error” message.

I found this article: Fix privileges and never again use sudo with npm |

And followed the instructions to fix the privileges. Issuing the following commands seemed to have fixed the privileges:
sudo chown -R $(whoami) /usr/local/lib/node_modules
sudo chown -R $(whoami) /usr/local/bin
sudo chown -R $(whoami) /usr/local/share

After the above, I upgraded npm npm install -g npm as the system said I needed to upgrade it when I issued the uninstall command.

I tried to uninstall particle again but the command did nothing. I still had it in the bin folder. So (by pure luck), I decided to run the particle-cli installation command again bash <( curl -sL ).
This time, the installation run successfully without the original errors I quoted at the beginning of this post.

It’s now working. Thanks for the help.