Can't install particle-cli OSX [SOLVED]

I have a breathing magenta photon… Don’t know what cause it but it is now breathing magenta no matter what and it’s kind of on erratic behavior. After a while it started flashing cyan.

Anyway… I want to install particle-cli to start figuring out what’s going on and being able to flash it using USB…

However I get a bunch of errors. I downloaded the latest node, re-installed… Remove node completely and NPM… Re-installed and I CAN’T get it to work. i am frustrated :frowning:

This is the output I get after running:

npm ERR! Darwin 14.5.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "-g" "install" "particle-cli"
npm ERR! node v4.0.0
npm ERR! npm  v2.14.2
npm ERR! code ELIFECYCLE

npm ERR! serialport@1.7.4 install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the serialport@1.7.4 install script 'node-pre-gyp install --fallback-to-build'.
npm ERR! This is most likely a problem with the serialport package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-pre-gyp install --fallback-to-build
npm ERR! You can get their info via:
npm ERR!     npm owner ls serialport
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/frlobo/npm-debug.log

Any clues?
It seems that I need an older version of Node? How do I achieve a downgrade??

Any helped would be appreciated!

1 Like

I just opened my KS Spark Core and installed node.js, but received the same error. This is the first time I’ve installed node.js onto my computer and I can’t install the Particle-Cli. Even using sudo fails. Please send help to this thread!

To get your photon out of safe mode (breathing magenta) please flash an app to it from the Web IDE (Build)

Just to add that i have added the breathing magenta notes here recently - https://docs.particle.io/support/troubleshooting-support/photon/#setup-process

Not working flashing code from web…

Anyhow… Need to be able yo flash locally…

Hope someone can help get the cli working…

Could you try this version?
https://nodejs.org/dist/v0.12.7/

1 Like

I was able to successfully install of Particle-CLI (v1.8.3) on Mac OS X 10.10.5.
I did it by completely removing the most current instillation of node.js (which was v4.0.0) by following this SO guide. Then I installed node.js v0.10.27 as per this Particle forum post and now it works!

Hope this helps!

PS. My core was pre 2014 so it had a solid magenta status led color after connecting to the wifi. Once Particle-CLI was installed and I was able to perform the deep update, the core is now successfully connected to the internet and the Spark app.

1 Like

Thank you. Will try to do that.

I think particle should support the latest nose version…

As @rmcclus1 and @Moors7 stated.

This is an issue with the latest version of Node… Installed v0.12.7 instead of 4.0 and it worked.

Also as @mdma stated, i retried flashing another program to the Photon and it kicked out of safe mode. For some reason, I had to do it three times to get it to work.

Thanks for the help!
This is an outstanding community!

I’m sure they will in due time. 4.0.0 hasn’t been out for long, but it was a major release, with breaking changes. The problem seems to be with the serialport package, which for some reason isn’t yet working on 4.0.0 (or so it seems).
I’m convinced they’ll try to get it working on the latest version as soon as they reasonably can.
@nexxy, any thoughts on this?

It is indeed a problem with the node-serialport package. Once that is compatible with node 4.0, we will update particle-cli to use the fixed version. I’ve listed this as a known issue on the README.

3 Likes

Looks like they got it working. Do you have an eta on node 4.x compatibility?

Yep, approximately 9 days ago:

2 Likes

I’m experiencing this problem, or something similar, on Debian. NodeJS is the elephant in the room. Also NodeJS is now on version 5.x. It’s been taking hours to troubleshoot these NodeJS/NPM installation problems on Debian, mainly because NPM packages exhibit dependency-spaghetti and take so long to download. Install operations commonly take 30 minutes to fail. It’s true I have a non-standard setup (I think - for that matter is there a standard/recommended stack?). Still, from my experience with NodeJS/NPM, these problems are par for the course. Fortunately I never ran other Node stuff on the machine (RPi), if I had it would definitely be broken. I’ll give Node v4 a shot.

p.s. - wait I always get confused by the even-version-number thingy with NodeJS - so I suppose 5.x is not the right version to use anyway.

update - I was able to get it installed on Raspbian Wheezy 7, Node 0.10.28, npm 1.4.9. It was little more than exercise in frustration with nodeJS and npm, and linux for that matter, because I’ll need to upgrade the pi to Jessie to get on the upgrade path anyway. It would be like…if Vindoze or Schlapple made me upgrade my OS to use NodeJS.