Cannot install/update Particle CLI on MacOS 10.11.6

Hi,
up to today my local server ran pretty stable and I had no trouble.
Now, after using “particle list” I was informed (and forced) to update particle cli (why?, never change a running system…) so I ran “npm update particle-list” and after doing so and tried to launch “particle list” the system told me “command not found”.
I tried “npm -g uninstall particle-cli” and got the response “up to date in 0.25 sec” (so nothing is deleting)
I’m running
npm 5.6.0
node v8.9.4
macOS 10.11.6
So how can I get rid of the old particle cli and how can I install the newest version?

Thanks for your help, Michael

Remove any old installation. If you get a command not found error, just go to the next step.

sudo npm uninstall -g particle-cli

Do:

which particle

If it reports one in /usr/local/bin/particle, remove that. It should not return anything, however.

sudo rm /usr/local/bin/particle

Then install using the Particle CLI installer:

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

There are additional instructions here if necessary:

https://docs.particle.io/guide/tools-and-features/cli/

1 Like

thank you so much for your quick response…

So this is what happens:


localhost:~ fiedel$ sudo npm uninstall -g particle-cli
Password:
up to date in 0.134s
localhost:~ fiedel$ which particle
localhost:~ fiedel$ bash <( curl -sL https://particle.io/install-cli )
Installing the Particle CLI to /Users/fiedel/bin/particle
Welcome to the Particle Command Line Interface!
Version 1.29.0
https://github.com/particle-iot/particle-cli

Usage: particle
Help: particle help

Commands:
binary Inspect binaries
call Call a particular function on a device
cloud Access Particle cloud functionality
compile Compile a source file, or directory using the cloud compiler
config Configure and switch between multiple accounts
device Manipulate a device
doctor Put your device back into a healthy state
flash Send firmware to your device
function Call functions on your device
get Retrieve a value from your device
identify Ask for and display device ID via serial
keys Manage your device’s key pair and server public key
library Manage firmware libraries
list Display a list of your devices, as well as their variables and
functions
login Login to the cloud and store an access token locally
logout Log out of your session and clear your saved access token
monitor Connect and display messages from a device
nyan Make your device shout rainbows
project Manage application projects
publish Publish an event to the cloud
serial Simple serial interface to your devices
setup Do the initial setup & claiming of your device
subscribe Listen to device event stream
token Manage access tokens (require username/password)
udp Talk UDP to repair devices, run patches, check Wi-Fi, and more!
update Update the system firmware of a device via USB
variable Retrieve and monitor variables on your device
webhook Manage webhooks that react to device event streams

Global Options:
-v, --verbose Increases how much logging to display [count]
-q, --quiet Decreases how much logging to display [count]

Options:
–version Show the version of particle-cli installed. [boolean]

Examples:
particle setup Set up your Particle account and
your device
particle list Show all your devices and their
functions and variables
particle flash my_device tinker Remotely update your device to run
the default Tinker app
particle call my_device_name Call a function on your device
digitalwrite D7=HIGH running Tinker to toggle the onboard
LED

For more information, visit our documentation at https://docs.particle.io

Get started by running "particle login"
If that doesn’t work, open a new terminal and make sure /Users/fiedel/bin is in your shell path.
If you previously installed the CLI with npm, run "npm uninstall -g particle-cli"
localhost:~ fiedel$ particle list
-bash: particle: command not found
localhost:~ fiedel$


Normally this should be at the end of the .profile file in your home directory:

# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then
    PATH="$HOME/bin:$PATH"
fi

If not, you may need to at it. It’s possible if you’re using a different shell, you may need to use a different file than .profile as well.

You can probably manually work around this temporarily by using the command:

~/bin/particle

instead of just particle, as well.

Hi, hmm it seems that I can start particle now, but using the former running proper well running server “node main.js” it’s doing some more trouble :

Error: Cannot find module '/Users/fiedel/spark-server/main.js’
at Function.Module._resolveFilename (module.js:538:15)
at Function.Module._load (module.js:468:25)
at Function.Module.runMain (module.js:684:10)
at startup (bootstrap_node.js:187:16)
at bootstrap_node.js:608:3

well…
It has been there, it worked fine and now it’s lost?
Thank you for your patience, Michael

…and still not working. Sucessfully installed by using the cmd “bash <( curl -sL https://particle.io/install-cli )” and then trying to launch “particle login” gives me “-bash: particle: command not found”.
All my home control is down, server is not running, no plan to reconstruct the former state, boah, to be honest…
Maybe there is solution other than reinstall all my photons… :frowning: