I've got node, and I set my npm prefix to something in my home folder, but when I try to install t2-cli it fails:
┌─[23:24:11/localhost/chronos/~]
└─╼ npm i -g t2-cli
/home/chronos/user/.npm-local/bin/cargo-tessel -> /home/chronos/user/.npm-local/lib/node_modules/t2-cli/bin/cargo-tessel.js
/home/chronos/user/.npm-local/bin/t2 -> /home/chronos/user/.npm-local/lib/node_modules/t2-cli/bin/tessel-2.js
> usb@1.2.0 install /home/chronos/user/.npm-local/lib/node_modules/t2-cli/node_modules/usb
> node-pre-gyp install --fallback-to-build
node-pre-gyp ERR! Tried to download: https://github.com/tessel/node-usb/releases/download/1.2.0/usb_bindings-v1.2.0-node-v48-linux-x64.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for usb@1.2.0 and node@6.9.4 (node-v48 ABI) (falling back to source compile with node-gyp)
make: Entering directory `/home/chronos/user/.npm-local/lib/node_modules/t2-cli/node_modules/usb/build'
CC(target) Release/obj.target/libusb/libusb/libusb/core.o
CC(target) Release/obj.target/libusb/libusb/libusb/descriptor.o
CC(target) Release/obj.target/libusb/libusb/libusb/hotplug.o
CC(target) Release/obj.target/libusb/libusb/libusb/io.o
CC(target) Release/obj.target/libusb/libusb/libusb/strerror.o
CC(target) Release/obj.target/libusb/libusb/libusb/sync.o
CC(target) Release/obj.target/libusb/libusb/libusb/os/poll_posix.o
CC(target) Release/obj.target/libusb/libusb/libusb/os/threads_posix.o
CC(target) Release/obj.target/libusb/libusb/libusb/os/linux_usbfs.o
CC(target) Release/obj.target/libusb/libusb/libusb/os/linux_udev.o
../libusb/libusb/os/linux_udev.c:40:21: fatal error: libudev.h: No such file or directory
#include <libudev.h>
^
compilation terminated.
make: *** [Release/obj.target/libusb/libusb/libusb/os/linux_udev.o] Error 1
make: Leaving directory `/home/chronos/user/.npm-local/lib/node_modules/t2-cli/node_modules/usb/build'
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/home/chronos/user/.npm-local/lib/node_modules/t2-cli/node_modules/npm/node_modules/node-gyp/lib/build.js:285:23)
gyp ERR! stack at emitTwo (events.js:106:13)
gyp ERR! stack at ChildProcess.emit (events.js:191:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12)
gyp ERR! System Linux 3.18.0-13985-g8bf2eb2
gyp ERR! command "/usr/local/bin/node" "/home/chronos/user/.npm-local/lib/node_modules/t2-cli/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--module=/home/chronos/user/.npm-local/lib/node_modules/t2-cli/node_modules/usb/src/binding/usb_bindings.node" "--module_name=usb_bindings" "--module_path=/home/chronos/user/.npm-local/lib/node_modules/t2-cli/node_modules/usb/src/binding"
gyp ERR! cwd /home/chronos/user/.npm-local/lib/node_modules/t2-cli/node_modules/usb
gyp ERR! node -v v6.9.4
gyp ERR! node-gyp -v v3.6.0
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute '/usr/local/bin/node /home/chronos/user/.npm-local/lib/node_modules/t2-cli/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/home/chronos/user/.npm-local/lib/node_modules/t2-cli/node_modules/usb/src/binding/usb_bindings.node --module_name=usb_bindings --module_path=/home/chronos/user/.npm-local/lib/node_modules/t2-cli/node_modules/usb/src/binding' (1)
node-pre-gyp ERR! stack at ChildProcess.<anonymous> (/home/chronos/user/.npm-local/lib/node_modules/t2-cli/node_modules/usb/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack at emitTwo (events.js:106:13)
node-pre-gyp ERR! stack at ChildProcess.emit (events.js:191:7)
node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:877:16)
node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
node-pre-gyp ERR! System Linux 3.18.0-13985-g8bf2eb2
node-pre-gyp ERR! command "/usr/local/bin/node" "/home/chronos/user/.npm-local/lib/node_modules/t2-cli/node_modules/usb/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /home/chronos/user/.npm-local/lib/node_modules/t2-cli/node_modules/usb
node-pre-gyp ERR! node -v v6.9.4
node-pre-gyp ERR! node-pre-gyp -v v0.6.30
node-pre-gyp ERR! not ok
Failed to execute '/usr/local/bin/node /home/chronos/user/.npm-local/lib/node_modules/t2-cli/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/home/chronos/user/.npm-local/lib/node_modules/t2-cli/node_modules/usb/src/binding/usb_bindings.node --module_name=usb_bindings --module_path=/home/chronos/user/.npm-local/lib/node_modules/t2-cli/node_modules/usb/src/binding' (1)
/home/chronos/user/.npm-local/lib
└── (empty)
npm ERR! Linux 3.18.0-13985-g8bf2eb2
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "i" "-g" "t2-cli"
npm ERR! node v6.9.4
npm ERR! npm v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! usb@1.2.0 install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the usb@1.2.0 install script 'node-pre-gyp install --fallback-to-build'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the usb 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 information on how to open an issue for this project with:
npm ERR! npm bugs usb
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls usb
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /home/chronos/user/npm-debug.log
npm ERR! code 1
Maybe I'm missing some basic stuff, like some C headers? Not sure what to install in Chrome OS yet though. I'm just using Chromebrew so far to install stuff, not Crouton (otherwise I probably wouldn't have this problem, but I wanted to avoid being heavy-weight by using Chromebrew in vanilla Chrome OS).