Hi,
New to Balena and trying to get everything up and running. I’ve been following the guide: https://www.balena.io/open/docs/getting-started/ however when I try to install the balena-cli I constantly get errors. I’ve tried via windows command prompt and Windows Subsytem for Linux on Ubuntu 18.4.
I’ve also seen people use: sudo npm -g i balena-cli
but I still get the same error:
npm WARN deprecated graceful-fs@3.0.11: please upgrade to graceful-fs 4 for compatibility with current and future versions of Node.js
npm WARN deprecated natives@1.1.6: This module relies on Node.js's internals and will break at some point. Do not use it, and update to graceful-fs@4.x.
npm WARN deprecated graceful-fs@1.2.3: please upgrade to graceful-fs 4 for compatibility with current and future versions of Node.js
/usr/local/bin/balena -> /usr/local/lib/node_modules/balena-cli/bin/balena
> husky@1.3.1 install /usr/local/lib/node_modules/balena-cli/node_modules/husky
> node husky install
husky > setting up git hooks
Can't find .git, skipping Git hooks installation.
Please check that you're in a cloned repository or run 'git init' to create an empty Git repository and reinstall husky.
> ext2fs@1.0.27 install /usr/local/lib/node_modules/balena-cli/node_modules/ext2fs
> prebuild-install || node-gyp rebuild
> mountutils@1.3.17 install /usr/local/lib/node_modules/balena-cli/node_modules/mountutils
> prebuild-install || node-gyp rebuild
prebuild-install WARN install No prebuilt binaries found (target=8.10.0 runtime=node arch=x64 platform=linux)
make: Entering directory '/usr/local/lib/node_modules/balena-cli/node_modules/mountutils/build'
CXX(target) Release/obj.target/MountUtils/src/mountutils.o
CXX(target) Release/obj.target/MountUtils/src/worker-unmount.o
CXX(target) Release/obj.target/MountUtils/src/worker-eject.o
CXX(target) Release/obj.target/MountUtils/src/linux/functions.o
../src/linux/functions.cpp: In function ‘MOUNTUTILS_RESULT unmount_disk(const char*)’:
../src/linux/functions.cpp:98:21: warning: unused variable ‘result_code’ [-Wunused-variable]
MOUNTUTILS_RESULT result_code = MOUNTUTILS_SUCCESS;
^~~~~~~~~~~
SOLINK_MODULE(target) Release/obj.target/MountUtils.node
COPY Release/MountUtils.node
make: Leaving directory '/usr/local/lib/node_modules/balena-cli/node_modules/mountutils/build'
> drivelist@6.4.6 install /usr/local/lib/node_modules/balena-cli/node_modules/drivelist
> prebuild-install || node-gyp rebuild
prebuild-install WARN install No prebuilt binaries found (target=8.10.0 runtime=node arch=x64 platform=linux)
make: Entering directory '/usr/local/lib/node_modules/balena-cli/node_modules/drivelist/build'
CXX(target) Release/obj.target/drivelist/src/drivelist.o
CXX(target) Release/obj.target/drivelist/src/device-descriptor.o
CXX(target) Release/obj.target/drivelist/src/linux/list.o
SOLINK_MODULE(target) Release/obj.target/drivelist.node
COPY Release/drivelist.node
make: Leaving directory '/usr/local/lib/node_modules/balena-cli/node_modules/drivelist/build'
> xxhash@0.2.4 install /usr/local/lib/node_modules/balena-cli/node_modules/xxhash
> node-gyp rebuild
make: Entering directory '/usr/local/lib/node_modules/balena-cli/node_modules/xxhash/build'
CXX(target) Release/obj.target/hash/src/hash.o
SOLINK_MODULE(target) Release/obj.target/hash.node
COPY Release/hash.node
make: Leaving directory '/usr/local/lib/node_modules/balena-cli/node_modules/xxhash/build'
> usb@1.3.5 install /usr/local/lib/node_modules/balena-cli/node_modules/usb
> node-pre-gyp install --fallback-to-build
node-pre-gyp WARN Using request for node-pre-gyp https download
node-pre-gyp WARN Tried to download(404): https://github.com/thundron/node-usb/releases/download/1.3.5/usb_bindings-v1.3.5-node-v57-linux-x64.tar.gz
node-pre-gyp WARN Pre-built binaries not found for usb@1.3.5 and node@8.10.0 (node-v57 ABI, glibc) (falling back to source compile with node-gyp)
make: Entering directory '/usr/local/lib/node_modules/balena-cli/node_modules/usb/build'
make: *** No rule to make target 'Release/obj.target/libusb/libusb/libusb/core.o', needed by 'Release/obj.target/usb.a'. Stop.
make: Leaving directory '/usr/local/lib/node_modules/balena-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 (/usr/share/npm/node_modules/node-gyp/lib/build.js:276:23)
gyp ERR! stack at emitTwo (events.js:126:13)
gyp ERR! stack at ChildProcess.emit (events.js:214:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
gyp ERR! System Linux 4.4.0-17763-Microsoft
gyp ERR! command "/usr/bin/node" "/usr/share/npm/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--module=/usr/local/lib/node_modules/balena-cli/node_modules/usb/src/binding/usb_bindings.node" "--module_name=usb_bindings" "--module_path=/usr/local/lib/node_modules/balena-cli/node_modules/usb/src/binding" "--napi_version=1" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v57"
gyp ERR! cwd /usr/local/lib/node_modules/balena-cli/node_modules/usb
gyp ERR! node -v v8.10.0
gyp ERR! node-gyp -v v3.2.1
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute '/usr/bin/node /usr/share/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build
--module=/usr/local/lib/node_modules/balena-cli/node_modules/usb/src/binding/usb_bindings.node --module_name=usb_bindings --module_path=/usr/local/lib/node_modules/balena-cli/node_modules/usb/src/binding --napi_version=1 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v57' (1)
node-pre-gyp ERR! stack at ChildProcess.<anonymous> (/usr/local/lib/node_modules/balena-cli/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack at emitTwo (events.js:126:13)
node-pre-gyp ERR! stack at ChildProcess.emit (events.js:214:7)
node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:925:16)
node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
node-pre-gyp ERR! System Linux 4.4.0-17763-Microsoft
node-pre-gyp ERR! command "/usr/bin/node" "/usr/local/lib/node_modules/balena-cli/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /usr/local/lib/node_modules/balena-cli/node_modules/usb
node-pre-gyp ERR! node -v v8.10.0
node-pre-gyp ERR! node-pre-gyp -v v0.11.0
node-pre-gyp ERR! not ok
Failed to execute '/usr/bin/node /usr/share/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/usr/local/lib/node_modules/balena-cli/node_modules/usb/src/binding/usb_bindings.node --module_name=usb_bindings --module_path=/usr/local/lib/node_modules/balena-cli/node_modules/usb/src/binding --napi_version=1 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v57' (1)
/usr/local/lib
└── (empty)
npm WARN optional Skipping failed optional dependency /balena-cli/removedrive:
npm WARN notsup Not compatible with your operating system or architecture: removedrive@1.1.2
npm WARN optional Skipping failed optional dependency /balena-cli/chokidar/fsevents:
npm WARN notsup Not compatible with your operating system or architecture: fsevents@1.2.8
npm WARN optional Skipping failed optional dependency /balena-cli/denymount/macmount:
npm WARN notsup Not compatible with your operating system or architecture: macmount@1.0.0
npm WARN optional Skipping failed optional dependency /balena-cli/etcher-sdk/winusb-driver-generator:
npm WARN notsup Not compatible with your operating system or architecture: winusb-driver-generator@1.2.4
npm WARN resin-register-device@5.0.0 requires a peer of resin-request@^9.0.2 but none was installed.
npm WARN ts-node@8.1.0 requires a peer of typescript@>=2.0 but none was installed.
npm ERR! Linux 4.4.0-17763-Microsoft
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "-g" "i" "balena-cli"
npm ERR! node v8.10.0
npm ERR! npm v3.5.2
npm ERR! code ELIFECYCLE
npm ERR! usb@1.3.5 install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the usb@1.3.5 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.
Can anyone suggest any alternatives?
I’m just trying it in an Ubuntu VM but ideally I need this via WSL
Thanks