Mac OSX 10.13.6 particle-cli error The Particle CLI requires Node >=6

particle-cli
Tags: #<Tag:0x00007f1ca2904ca8>

#1

In OSX trying to use particle on the CLI gives the following error, even when the installed node package is in fact greater than v6. Unclear how it got into this state, possibly after an OSX update?

~=Problem=~
➜ particle login
The Particle CLI requires Node >=6
➜ which node
/usr/local/bin/node
➜ node --version
v11.14.0

~=Solution=~
Remove the node package associated with the particle-cli module:
rm -rf the node package from the .particle directory

Remove the particle-cli module:
cd
npm root -g this will give the root folder of the global node install (likely will get /usr/local/lib/node_modules). For this solution let <path> = /usr/local/lib/node_modules
cd <path>
ls you should see the particle-cli folder
sudo rm -rf particle-cli/

Use npm to uninstall the particle-cli packages:
cd
sudo npm uninstall -g particle-cli
sudo npm uninstall particle-cli
May also need to do:
sudo npm uninstall -g spark-cli
sudo npm uninstall spark-cli

Verify that the particle-cli directory has been removed:
cd <path>
ls -la

Verify that particle isn’t recognized as a command any longer:
particle gives command not found

Reinstall particle-cli:
cd
npm install -g particle-cli

Test that it worked by logging in:
particle login


#2

Welcome to the community. Great that you have solved your problem. Was this the first time you installed Particle CLI? If this was an update I guess you know to use $ particle update-cli ?To help others who might encounter the same issue/problem - could you tick the solution box at the bottom of the thread.


#3

(repost to check-in as solution)