Sprint 6: Maker Shed, Command Line Interface, a getting started video, and an open source workflow

Ya that’s what I did.
Just tried it again and this is at the tail end of the log.

2426 verbose about to build /usr/local/lib/node_modules/spark-cli/node_modules/serialport/node_modules/optimist/node_modules/wordwrap
2427 info build /usr/local/lib/node_modules/spark-cli/node_modules/serialport/node_modules/optimist/node_modules/wordwrap
2428 verbose linkStuff [ true,
2428 verbose linkStuff   '/usr/local/lib/node_modules',
2428 verbose linkStuff   false,
2428 verbose linkStuff   '/usr/local/lib/node_modules/spark-cli/node_modules/serialport/node_modules/optimist/node_modules' ]
2429 info linkStuff wordwrap@0.0.2
2430 verbose linkBins wordwrap@0.0.2
2431 verbose linkMans wordwrap@0.0.2
2432 verbose rebuildBundles wordwrap@0.0.2
2433 info install wordwrap@0.0.2
2434 info postinstall wordwrap@0.0.2
2435 verbose about to build /usr/local/lib/node_modules/spark-cli/node_modules/serialport/node_modules/optimist
2436 info build /usr/local/lib/node_modules/spark-cli/node_modules/serialport/node_modules/optimist
2437 verbose linkStuff [ true,
2437 verbose linkStuff   '/usr/local/lib/node_modules',
2437 verbose linkStuff   false,
2437 verbose linkStuff   '/usr/local/lib/node_modules/spark-cli/node_modules/serialport/node_modules' ]
2438 info linkStuff optimist@0.3.7
2439 verbose linkBins optimist@0.3.7
2440 verbose linkMans optimist@0.3.7
2441 verbose rebuildBundles optimist@0.3.7
2442 verbose rebuildBundles [ 'wordwrap' ]
2443 info install optimist@0.3.7
2444 info postinstall optimist@0.3.7
2445 verbose about to build /usr/local/lib/node_modules/spark-cli/node_modules/serialport
2446 info build /usr/local/lib/node_modules/spark-cli/node_modules/serialport
2447 verbose linkStuff [ true,
2447 verbose linkStuff   '/usr/local/lib/node_modules',
2447 verbose linkStuff   false,
2447 verbose linkStuff   '/usr/local/lib/node_modules/spark-cli/node_modules' ]
2448 info linkStuff serialport@1.3.1
2449 verbose linkBins serialport@1.3.1
2450 verbose link bins [ { serialportlist: './bin/serialportList.js',
2450 verbose link bins     serialportterm: './bin/serialportTerminal.js' },
2450 verbose link bins   '/usr/local/lib/node_modules/spark-cli/node_modules/.bin',
2450 verbose link bins   false ]
2451 verbose linkMans serialport@1.3.1
2452 verbose rebuildBundles serialport@1.3.1
2453 verbose rebuildBundles [ 'async', 'bindings', 'nan', 'optimist', 'sf' ]
2454 info install serialport@1.3.1
2455 verbose unsafe-perm in lifecycle false
2456 info serialport@1.3.1 Failed to exec install script
2457 info /usr/local/lib/node_modules/spark-cli/node_modules/serialport unbuild
2458 info preuninstall serialport@1.3.1
2459 info uninstall serialport@1.3.1
2460 verbose false,/usr/local/lib/node_modules,/usr/local/lib/node_modules/spark-cli/node_modules unbuild serialport@1.3.1
2461 verbose /usr/local/lib/node_modules/spark-cli/node_modules/.bin,[object Object] binRoot
2462 info postuninstall serialport@1.3.1
2463 verbose about to build /usr/local/lib/node_modules/spark-cli
2464 info /usr/local/lib/node_modules/spark-cli unbuild
2465 info preuninstall spark-cli@0.2.92
2466 info uninstall spark-cli@0.2.92
2467 verbose true,/usr/local/lib/node_modules,/usr/local/lib/node_modules unbuild spark-cli@0.2.92
2468 verbose /usr/local/bin,[object Object] binRoot
2469 info postuninstall spark-cli@0.2.92
2470 error serialport@1.3.1 install: `node-gyp rebuild`
2470 error Exit status 127
2471 error Failed at the serialport@1.3.1 install script.
2471 error This is most likely a problem with the serialport package,
2471 error not with npm itself.
2471 error Tell the author that this fails on your system:
2471 error     node-gyp rebuild
2471 error You can get their info via:
2471 error     npm owner ls serialport
2471 error There is likely additional logging output above.
2472 error System Darwin 13.1.0
2473 error command "node" "/usr/local/bin/npm" "install" "-g" "spark-cli"
2474 error cwd /Users/jacob/Documents/sparkcore
2475 error node -v v0.10.26
2476 error npm -v 1.4.3
2477 error code ELIFECYCLE
2478 verbose exit [ 1, true ]

@jfenwick the module ‘serialport’ seems like the culprit…

You have python 2.7 installed yet?

cyberdelia:sparkcore jacob$ python
Python 2.7.5 (default, Sep 12 2013, 21:33:34)

Hmmmmmmm.

What about this requirement for serialport:

Mac OS X:

Ensure that you have at a minimum the xCode Command Line Tools installed appropriate for your system configuration. If you recently upgraded the OS, it probably removed your installation of Command Line Tools, please verify before submitting a ticket.

This is what’s in my Xcode preferences:

This directory exists and has lots of files in it, which is what I believe is what I need:
/Applications/Xcode.app/Contents/Developer/usr/bin

Ohh, this:

This has some good methods for verifying whether you have the tools installed.
ls -l /usr/include/AvailabilityMacros.h and see if it exists.
If it doesn’t run xcode-select --install

However, now I’m running into a different error:

2034 info uninstall spark-cli@0.2.92
2035 verbose true,/usr/local/lib/node_modules,/usr/local/lib/node_modules unbuild spark-cli@0.2.92
2036 verbose /usr/local/bin,[object Object] binRoot
2037 info postuninstall spark-cli@0.2.92
2038 error Error: ENOENT, lstat '/usr/local/lib/node_modules/spark-cli/node_modules/request/node_modules/tough-cookie/node_modules/punycode/LICENSE-GPL.txt'
2039 error If you need help, you may report this *entire* log,
2039 error including the npm and node versions, at:
2039 error     <http://github.com/npm/npm/issues>
2040 error System Darwin 13.1.0
2041 error command "node" "/usr/local/bin/npm" "install" "-g" "spark-cli"
2042 error cwd /Users/jacob/Documents/sparkcore
2043 error node -v v0.10.26
2044 error npm -v 1.4.3
2045 error path /usr/local/lib/node_modules/spark-cli/node_modules/request/node_modules/tough-cookie/node_modules/punycode/LICENSE-GPL.txt
2046 error fstream_path /usr/local/lib/node_modules/spark-cli/node_modules/request/node_modules/tough-cookie/node_modules/punycode/LICENSE-GPL.txt
2047 error fstream_type File
2048 error fstream_class FileWriter
2049 error code ENOENT
2050 error errno 34
2051 error fstream_stack /usr/local/lib/node_modules/npm/node_modules/fstream/lib/writer.js:284:26
2051 error fstream_stack Object.oncomplete (fs.js:107:15)
2052 verbose exit [ 34, true ]

Hmm. Could be a permissions thing? Maybe try a

sudo npm install -g spark-cli

That is what I’m doing.
I get the feeling that when it calls node from inside the node-gyp script, it’s not doing it as sudo, so it can’t find the command.

Hmm, and you’re on the latest nodejs, and npm… Have you done an npm update? / Brew update / Brew upgrade nodejs?

One thing that you can try is npm install serialport. If this works, it might fix the problem; if not, it might at least provide a more verbose output for the errors

Also, the README for node-serialport might provide some help:

I think one of these commands fixed it:
sudo chmod 755 /usr/local/bin
sudo chown -R whoami /usr/local/bin/node
sudo chown -R whoami /usr/local/bin/npm

2 Likes