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


#61

This NPM sounds interesting, especially since I am now trying to learn JavaScript. I’m not quite sure what this particular NPM page has to do with needing to run in supervisor state or errors, though.


#62

@MarkSHarrisTX it will definitely be useful for you in your quest to learn JavaScript (and Node.js).

As for how that page relates to your problems; performing one of the two fixes outlined in the document will eliminate the need to use sudo when executing npm commands (such as npm install serialport).

Given some of the other error output you posted, I don’t think this is the root of the problem, but it will help.


#63

Thank you. Okay, I’ll keep JavaScript and Node.Js on my things to learn list.
Unfortunately, its like peeling an onion.
Which is the case with Spark-cli. It sounds like a wonderful tool. If I can get it working.
But I’m still battling problems with the online build process (the web) and I need to fix that first.
There right now, I’m not seeing a blinking magenta upon download. No change from slowly flashing pale blue.


#64

Been trying sudo npm install -g spark-cli I’ve got all error when trying all these things

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

child_process: customFds option is deprecated, use stdio instead.
gyp WARN install got an error, rolling back install
gyp ERR! configure error
gyp ERR! stack Error: EPERM, utime '/Users/Paolo/.node-gyp/0.12.0’
gyp ERR! stack at Error (native)
gyp ERR! System Darwin 14.1.0
gyp ERR! command “/usr/local/bin/node” “/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js” “rebuild” “–name=serialport” “–configuration=Release” “–module_name=serialport” “–version=1.4.5” “–major=1” “–minor=4” “–patch=5” “–runtime=node” “–node_abi=node-v14” “–platform=darwin” “–target_platform=darwin” “–arch=x64” “–target_arch=x64” “–module_main=./serialport” “–host=https://node-serialport.s3.amazonaws.com/” “–module_path=/usr/local/lib/node_modules/spark-cli/node_modules/serialport/build/serialport/v1.4.5/Release/node-v14-darwin-x64” “–remote_path=./serialport/v1.4.5/Release/” “–package_name=node-v14-darwin-x64.tar.gz” “–staged_tarball=build/stage/serialport/v1.4.5/Release/node-v14-darwin-x64.tar.gz” “–hosted_path=https://node-serialport.s3.amazonaws.com/serialport/v1.4.5/Release/” "–hosted_tarball=https://node-serialport.s3.amazonaws.com/serialport/v1.4.5/Release/node-v14-darwin-x64.tar.gz"
gyp ERR! cwd /usr/local/lib/node_modules/spark-cli/node_modules/serialport
gyp ERR! node -v v0.12.0
gyp ERR! node-gyp -v v1.0.2
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute ‘/usr/local/bin/node rebuild --name=serialport --configuration=Release --module_name=serialport --version=1.4.5 --major=1 --minor=4 --patch=5 --runtime=node --node_abi=node-v14 --platform=darwin --target_platform=darwin --arch=x64 --target_arch=x64 --module_main=./serialport --host=https://node-serialport.s3.amazonaws.com/ --module_path=/usr/local/lib/node_modules/spark-cli/node_modules/serialport/build/serialport/v1.4.5/Release/node-v14-darwin-x64 --remote_path=./serialport/v1.4.5/Release/ --package_name=node-v14-darwin-x64.tar.gz --staged_tarball=build/stage/serialport/v1.4.5/Release/node-v14-darwin-x64.tar.gz --hosted_path=https://node-serialport.s3.amazonaws.com/serialport/v1.4.5/Release/ --hosted_tarball=https://node-serialport.s3.amazonaws.com/serialport/v1.4.5/Release/node-v14-darwin-x64.tar.gz’ (1)
node-pre-gyp ERR! stack at ChildProcess. (/usr/local/lib/node_modules/spark-cli/node_modules/serialport/node_modules/node-pre-gyp/lib/util/compile.js:76:29)
node-pre-gyp ERR! stack at ChildProcess.emit (events.js:110:17)
node-pre-gyp ERR! stack at maybeClose (child_process.js:1008:16)
node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:1080:5)
node-pre-gyp ERR! System Darwin 14.1.0
node-pre-gyp ERR! command “node” “/usr/local/lib/node_modules/spark-cli/node_modules/serialport/node_modules/.bin/node-pre-gyp” “install” "–fallback-to-build"
node-pre-gyp ERR! cwd /usr/local/lib/node_modules/spark-cli/node_modules/serialport
node-pre-gyp ERR! node -v v0.12.0
node-pre-gyp ERR! node-pre-gyp -v v0.5.19
node-pre-gyp ERR! not ok
Failed to execute ‘/usr/local/bin/node rebuild --name=serialport --configuration=Release --module_name=serialport --version=1.4.5 --major=1 --minor=4 --patch=5 --runtime=node --node_abi=node-v14 --platform=darwin --target_platform=darwin --arch=x64 --target_arch=x64 --module_main=./serialport --host=https://node-serialport.s3.amazonaws.com/ --module_path=/usr/local/lib/node_modules/spark-cli/node_modules/serialport/build/serialport/v1.4.5/Release/node-v14-darwin-x64 --remote_path=./serialport/v1.4.5/Release/ --package_name=node-v14-darwin-x64.tar.gz --staged_tarball=build/stage/serialport/v1.4.5/Release/node-v14-darwin-x64.tar.gz --hosted_path=https://node-serialport.s3.amazonaws.com/serialport/v1.4.5/Release/ --hosted_tarball=https://node-serialport.s3.amazonaws.com/serialport/v1.4.5/Release/node-v14-darwin-x64.tar.gz’ (1)
npm ERR! Darwin 14.1.0
npm ERR! argv “node” “/usr/local/bin/npm” “install” “-g” "spark-cli"
npm ERR! node v0.12.0
npm ERR! npm v2.5.1
npm ERR! code ELIFECYCLE

npm ERR! serialport@1.4.5 install: node-pre-gyp install --fallback-to-build
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the serialport@1.4.5 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/Paolo/npm-debug.log

#65

Hi,

I had the same issue today.
Not sure if you guys are still having the same problems, but I’ve installed Node 0.10.x and it all works fine for me

I hope this helps


#66

I’m having a hard time getting spark cli installed.

Anyone have any help for me with the info below? Thx Jim

$ npm install -g spark-cli

throws this:

npm WARN locking Error: EACCES, open '/Users/Jim Livingston/.npm/_locks/spark-cli-2df4e0b4624ec45e.lock'
npm WARN locking     at Error (native)
npm WARN locking  /Users/Jim Livingston/.npm/_locks/spark-cli-2df4e0b4624ec45e.lock failed { [Error: EACCES, open '/Users/Jim Livingston/.npm/_locks/spark-cli-2df4e0b4624ec45e.lock']
npm WARN locking   errno: -13,
npm WARN locking   code: 'EACCES',
npm WARN locking   path: '/Users/Jim Livingston/.npm/_locks/spark-cli-2df4e0b4624ec45e.lock' }
npm ERR! Darwin 14.1.0
npm ERR! argv "node" "/usr/local/bin/npm" "install" "-g" "spark-cli"
npm ERR! node v0.12.2
npm ERR! npm  v2.7.4

npm ERR! Attempt to unlock /usr/local/lib/node_modules/spark-cli, which hasn't been locked
npm ERR! 
npm ERR! If you need help, you may report this error at:
npm ERR!     <https://github.com/npm/npm/issues>

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

#67

This looks like a permissions problem. Try “sudo npm install -g spark-cli” to run the installer as root.


#68

OK, that changed things a little, no EACCESS errors… Jim

$ sudo npm install -g spark-cli

asks for a password, after providing it, I get:

> 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! Darwin 14.1.0
npm ERR! argv "node" "/usr/local/bin/npm" "install" "-g" "spark-cli"
npm ERR! node v0.12.2
npm ERR! npm  v2.7.4
npm ERR! code ELIFECYCLE

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 '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/Jim Livingston/npm-debug.log

#69

@jim,

what does sudo npm install -g serialport say?


#70

@kennethlimcp:

$ sudo npm install -g serialport
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.6.3 install /usr/local/lib/node_modules/serialport
> node-pre-gyp install --fallback-to-build

env: node: No such file or directory
npm ERR! Darwin 14.1.0
npm ERR! argv "node" "/usr/local/bin/npm" "install" "-g" "serialport"
npm ERR! node v0.12.2
npm ERR! npm  v2.7.4
npm ERR! code ELIFECYCLE

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 '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/Jim Livingston/npm-debug.log

#71

Can we do a… sudo npm install -g spark-cli@1.5.0


#72

@kennethlimcp:
OK, here goes…

$ sudo npm install -g spark-cli@1.5.0
Password:
npm ERR! Darwin 14.1.0
npm ERR! argv "node" "/usr/local/bin/npm" "install" "-g" "spark-cli@1.5.0"
npm ERR! node v0.12.2
npm ERR! npm  v2.7.4

npm ERR! version not found: spark-cli@1.5.0
npm ERR! 
npm ERR! If you need help, you may report this error at:
npm ERR!     <https://github.com/npm/npm/issues>

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


#73

Oh no…my bad! sudo npm install -g serialport@1.5.0

Paste your output in this format so that it looks better:

```
#paste code here
```

#74

OK, here it is…

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! Darwin 14.1.0
npm ERR! argv "node" "/usr/local/bin/npm" "install" "-g" "serialport@1.5.0"
npm ERR! node v0.12.2
npm ERR! npm  v2.7.4
npm ERR! code ELIFECYCLE

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 '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/Jim Livingston/npm-debug.log

#75

Hmmm there’s some weirdness with you installing the serialport package. What version is your mac osx on?


#76

@kennethlimcp

I’m on 10.10.2
J


#77

@jimbol, can you do a node --version?


#78

@kennethlimcp:

 node --version

v0.12.2

#79

Ah… Can we try nodejs v0.10?


#80

Sure, but how do I install the older version?