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


#21

Can you show me a screenshot of your terminal?

Also your Mac OSx version


#22

My OSX is version 10.9.4


#23

Can you cd to Desktop directory and try again?

Also, use sudo npm install -g spark-cli


#24

No dice :frowning:

KSTLENGMAC71LD:dev rcompton$ cd ~
KSTLENGMAC71LD:~ rcompton$ cd Desktop/
KSTLENGMAC71LD:Desktop rcompton$ sudo npm install -g spark-cli
Password:

serialport@1.4.0 install /usr/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.4.0 install: node-pre-gyp install --fallback-to-build
npm ERR! Exit status 127
npm ERR!
npm ERR! Failed at the serialport@1.4.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 13.3.0
npm ERR! command “node” “/usr/local/bin/npm” “install” “-g” "spark-cli"
npm ERR! cwd /Users/rcompton/Desktop
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/rcompton/Desktop/npm-debug.log
npm ERR! not ok code 0


#25

Can you change owner to yourself for this folder:

sudo chown -R rcompton /Users/rcompton/.npm/


#26

Just did that. Still getting the same error when executing “sudo npm install -g spark-cli”


#27

Can you do npm install -g serialport?


#28

No, getting the same error about it not being able to find “node”:
krnohmrn23v3760:~ root# npm install -g serialport
/usr/bin/serialportlist -> /usr/lib/node_modules/serialport/bin/serialportList.js
/usr/bin/serialportterm -> /usr/lib/node_modules/serialport/bin/serialportTerminal.js

serialport@1.4.2 install /usr/lib/node_modules/serialport
node-pre-gyp install --fallback-to-build

env: node: No such file or directory
npm ERR! serialport@1.4.2 install: node-pre-gyp install --fallback-to-build
npm ERR! Exit status 127
npm ERR!
npm ERR! Failed at the serialport@1.4.2 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 13.3.0
npm ERR! command “node” “/usr/local/bin/npm” “install” “-g” "serialport"
npm ERR! cwd /private/var/root
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!     /private/var/root/npm-debug.log
npm ERR! not ok code 0


#29

@kennethlimcp
I know I have node installed on my computer. Very strange that the script is complaining of not knowing where it is.

krnohmrn23v3760:bin root# ls -al node
-rwxr-xr-x  1 24561  wheel  20040480 Jun  9 12:22 node
krnohmrn23v3760:bin root# pwd
/usr/local/bin
krnohmrn23v3760:bin root# ls -al /usr/bin/node
lrwxr-xr-x  1 root  wheel  19 Jul 18 17:03 /usr/bin/node -> /usr/local/bin/node


#30

Hmm… weird. It probably has to do with how node.js is installed. Can you install it again?

Also, do you have multiple users on this mac?


#31

I re-installed it and had the same problem. There are multiple users on this Mac but it’s only me that regularly logs into this computer.
Thanks for your help. I’ll mess around with it later.


#32

I think that the problem is the installation might need an Administrator account (sudo should work but doesn’t seem like the case) since the dir it is trying to extract to is not accessible by yours.


#33

Hi @kennethlimcp, could you extend this tutorial to include the installation instructions for dfu-util on a Mac?


#34

@NanoAkron, sure! I will add in tonight (aka your morning) if there’s some time to spare.

It’s kinda straight-forward in Mac OSx and you can try: https://github.com/spark/core-firmware#3-device-firmware-upgrade-utilities :wink:


#35

@NanoAkron,

I have added the DFU-util instructions above. It’s a 2 step command so you should probably be able to install successfully :wink:

Thanks!!


#36

I’m getting the same sort of serialport error as above, but reinstalling node-pre-gyp and serialport didn’t help. I also tried the system link line. Here is my error code if that helps.


jordanjalles$ sudo npm install -g spark-cli
|
> serialport@1.4.5 install /usr/lib/node_modules/spark-cli/node_modules/serialport
> node-pre-gyp install --fallback-to-build

sh: node-pre-gyp: command not found

npm ERR! Darwin 10.8.0
npm ERR! argv "node" "/usr/local/bin/npm" "install" "-g" "spark-cli"
npm ERR! node v0.10.32
npm ERR! npm  v2.0.0
npm ERR! code ELIFECYCLE
npm ERR! serialport@1.4.5 install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 127
npm ERR! 
npm ERR! Failed at the serialport@1.4.5 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.

#37

Can you try and see if this helps?


#38

I poked around in the xcode gui but it didn’t ask me for any agreements


#39

I could imagine that its an access right issue like

Would recommend trying to chown the folders back to your user trying npm install -g spark-cli without sudo afterwards!

Good luck! :sunflower:


#40

That did the trick. Opened Xcode, agreed to terms and conditions and it was working for me :smile:
Thanks @kennethlimcp!