Hello
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 https://particle.io/install-cli )" 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.
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: http://www.apple.com/legal/sla/ Type A and press return to agree: a
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.
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 https://particle.io/install-cli ).
This time, the installation run successfully without the original errors I quoted at the beginning of this post.