Tutorial: Particle-cli on Mac OSX [26 Sep 2015]


#81

Try this: http://nodejs.org/dist/v0.10.29/

It’s the same version on mine so we can eliminate one variable.


#82

OK, Thanks. I feel a little out of my league here, I can follow the link to it, but I don’t know what to do to get rid of the old version and install the new.
J


#83

Opps sorry: http://nodejs.org/dist/v0.10.29/node-v0.10.29.pkg


#84

@kennethlimcp

I really appreciate the help, I’d never get thru this without it!

OK, node 0.10.29 installed -

sudo npm install -g spark-cli

Gives me:

> serialport@1.6.3 install /usr/local/lib/node_modules/spark-cli/node_modules/serialport
> node-pre-gyp install --fallback-to-build

env: node: No such file or directory
npm ERR! serialport@1.6.3 install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 127
npm ERR! 
npm ERR! Failed at the serialport@1.6.3 install script.
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! System Darwin 14.1.0
npm ERR! command "node" "/usr/local/bin/npm" "install" "-g" "spark-cli"
npm ERR! cwd /Users/Jim Livingston
npm ERR! node -v v0.10.29
npm ERR! npm -v 1.4.14
npm ERR! code ELIFECYCLE
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /Users/Jim Livingston/npm-debug.log
npm ERR! not ok code 0

#85

One last try before i open an issue with serialport…

Sudo npm install -g serialport@1.5.0


#86

@kennethlimcp

OK here’s the latest…
J

Sudo npm install -g serialport@1.5.0
Password:
/usr/local/bin/serialportlist -> /usr/local/lib/node_modules/serialport/bin/serialportList.js
/usr/local/bin/serialportterm -> /usr/local/lib/node_modules/serialport/bin/serialportTerminal.js
 
> serialport@1.5.0 install /usr/local/lib/node_modules/serialport
> node-pre-gyp install --fallback-to-build

env: node: No such file or directory
npm ERR! serialport@1.5.0 install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 127
npm ERR! 
npm ERR! Failed at the serialport@1.5.0 install script.
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! System Darwin 14.1.0
npm ERR! command "node" "/usr/local/bin/npm" "install" "-g" "serialport@1.5.0"
npm ERR! cwd /Users/Jim Livingston
npm ERR! node -v v0.10.29
npm ERR! npm -v 1.4.14
npm ERR! code ELIFECYCLE
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /Users/Jim Livingston/npm-debug.log
npm ERR! not ok code 0
Jims-MacBook-Pro:~ Jim Livingston$

#87

There was something earlier in this thread (don’t remember what, exactly) that made me wonder if you have multiple versions of node installed… Can you tell us what this says, too:

sudo node --version

Update: nevermind, it shows the versions of node and npm in the error output. Bah, still stumped. I just installed serialport on my work Windows laptop with no trouble (node 0.12.2).


#88

@dougal
Well,
thanks for looking at it.
This is a mac, tho…
J


#89

@Jim,

sorry that i couldn’t help much as this dependency is not written by Spark.

I have filed an issue hoping for a response soon: https://github.com/voodootikigod/node-serialport/issues/496


#90

So I had similar symptoms on my older 10.6.8 mac. There is no pre-compiled binary for that version of OS X, so it tried to build the serialport module from sources but I didn’t have a proper environment to build and failed.

Have you tried installing xcode?


#91

@kennethlimcp,
No problem, thanks for the effort.
I’m about to head off to sea and probably won’t be able to do any further, while out there I can’t use spark build to mess with things, flashing a core with the high latency connection doesn’t usually work.
J


#92

Yeah, what @bko said – Make sure you’ve installed XCode and its command-line tools. I think what’s happening is that it’s trying to do a build-from-source, but you’re missing the tools for that.

If I get a chance to get on my Mac tonight at home, I’ll try to see if I can test that.


#93

@bko
I have Xcode 6.2 installed, and just added the Command line tools as well after seeing @dougal’s comment.
Tried again with the same results.

J


#94

does dfu-util work on Mac? im guessing it must because thats what the cli uses to flash right??

what about the old school way of flashing before all the easy cli stuff came about?

dfu-util -d 1d50:607f -a 0 -s 0x08005000:leave -D firmware.bin

#95

@jimbol,

there’s a reply here: https://github.com/voodootikigod/node-serialport/issues/496#issuecomment-90682971

Seems like node is not in your path. Can you try node --version ?


#96

@kennethlimcp

$ node --version
v0.10.29

Its there!
J


#97

I’ve got Yosemite (10.10.1) and it worked for me after downgrading from Node v0.12.2 to v0.10.29.
What I did (if I remember well) was:

sudo npm install -g spark-cli
rm -r ~/.node-gyp
sudo npm install -g serialport --verbose
sudo npm install -g serialport
sudo npm install -g serialport@1.5.0
(was not working because of the wrong version of node (v0.12.2). Going back to v0.10.29 solved the issue.
http://nodejs.org/dist/v0.10.29/node-v0.10.29.pkg

Then to install dfu-util I used brew:
Install http://brew.sh/
and then in Terminal brew install dfu-util

Hope this can be of help


#98

@accio Thanks for the info. Below you’ll see I’m still hung up. v0.10.29 is installed.

@kennethlimcp: just had a bit of time to try this again, still the same outcome.

I still can’t get past

sudo npm install -g spark-cli

It gives me:

$ sudo npm install -g spark-cli
Password:

serialport@1.6.3 install /usr/local/lib/node_modules/spark-cli/node_modules/serialport
node-pre-gyp install --fallback-to-build

env: node: No such file or directory
npm ERR! serialport@1.6.3 install: node-pre-gyp install --fallback-to-build
npm ERR! Exit status 127
npm ERR!
npm ERR! Failed at the serialport@1.6.3 install script.
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! System Darwin 14.1.0
npm ERR! command “node” “/usr/local/bin/npm” “install” “-g” "spark-cli"
npm ERR! cwd /Users/Jim Livingston
npm ERR! node -v v0.10.29
npm ERR! npm -v 1.4.14
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /Users/Jim Livingston/npm-debug.log
npm ERR! not ok code 0

I feel like I may just have to wait for the web interface for creating and managing Webhooks, before I can get any further.

J


#99

Looking at this line, you might want to check out this article: http://stackoverflow.com/a/20077620


#100

Thanks @kennethlimcp,
No luck with that either.

Do you have any idea when the web interface for using web hooks is scheduled to launch?

J