Javascript APIs - tutorials - how to install?

Hello :smile:
.
To start with: thank you for reading :smiley:
.
I have a problem, I will describe it and what I do. The problem occurs with the command: 'npm install metawear'.
I tried on different Ubuntu / Debian versions, nodeJS (8.x, 10.x, 12.x) and the problem still shows up.
.
Need: go step by step go tutorial https://mbientlab.com/tutorials/JsLinux.html
.
I've already done a tutorial on: Windows C # and Windows Python (everything works). But there is clearly something wrong with that :smile:
.
1. Downloading virtualBox - it's installing
2. Download the Ubuntu / Debian image (I have tested probably 5 different versions of ready-made virtuals + installed the system myself)
3. Run Virtualbox (currently Ubuntu 18.04.03).
--- in uBuntu: ---
.
.
1. Mounts bluetooth (-OK):

.
.
2. finds sensors (-OK):

.
.
3. later commands (-OK):
(internet is ping google.com - replies)
sudo apt-get update
sudo apt upgrade
.
4. From tutorial: sudo apt install bluetooth pi-bluetooth bluez blueman bluez-utils
.
sudo apt install bluetooth - OK
.
sudo apt install pi-bluetooth - ERROR (solution: https://snapcraft.io/install/pi-bluetooth-enable/ubuntu) so:
OK (https://snapcraft.io/install/pi-bluetooth-enable/ubuntu):
sudo apt install snapd
sudo snap install pi-bluetooth-enable --edge - OK

sudo apt install bluez - OK
sudo apt install blueman - OK
sudo apt install bluez-utils - error! so:

.
sudo apt install bluez * - OK
.
5. now install nodejs
sudo apt install nodejs - OK
.
node -v
GET: v8.10.0
.
6. sudo apt-get install -y build-essential

.
.
7. sudo apt-get install npm
sudo apt-get install npm
npm -v
GET: 3.5.2

.
.
now: Tutorial: 2.2.1. Install Dev tools
>>> sudo apt-get install build-essential
GET: build-essential is already the newest version (12.4ubuntu1).
.
>>> sudo apt-get install bluez
GET: bluez is already the newest version (5.48-0ubuntu3.4).
.
.
>>> sudo apt-get install libboost-all-dev - OK
>>> sudo apt-get install libbluetooth-dev - OK
.
next:
>>> sudo apt-get install libusb-dev - OK
>>> sudo apt-get install libudev-dev - OK
.
GIT:
sudo apt-get install git-core - OK
git --version
GET: git version 2.17.1
.
.
..............................................................................
And now from tutorial: 2.3. MetaWear
npm install metawear - ERROR!
.

.
But I must:
npm install usb
.
a) versionA
npm install metawear
Error:
npm WARN optional Skipping failed optional dependency /noble/xpc-connection:
npm WARN notsup Not compatible with your operating system or architecture: xpc-connection@0.1.4
.

.
movie:
.
.
.
b) VersionB
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack at ChildProcess.emit (events.js:314:20)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
gyp ERR! System Linux 4.19.0-11-amd64
gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/debian/node_modules/ref
gyp ERR! node -v v12.19.0
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok
npm WARN enoent ENOENT: no such file or directory, open '/home/debian/package.json'
npm WARN debian No description
npm WARN debian No repository field.
npm WARN debian No README data
npm WARN debian No license field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: xpc-connection@0.1.4 (node_modules/xpc-connection):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for xpc-connection@0.1.4: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! ref@1.3.5 install: `node-gyp rebuild``` npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the ref@1.3.5 install script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above. . npm ERR! A complete log of this run can be found in: npm ERR! /home/debian/.npm/_logs/2020-10-14T10_11_09_562Z-debug.log``
.
.
.

.
movie:
.
.
I tried on virtual machines:

but i always have some errors.
.
please help :smile:
.
.
.
.
questions:
1. Does anyone have a virtual disk with JS-API?
2. Can anyone correct this error?

Comments

  • edited October 2020

    In your first movie it looks like it installed just fine. You just got a warning, no errors.
    Your version A is good to go. Just npm update metawear and done.

  • ok.
    .
    npm udate - ERROR:

    .
    move:

    .
    .
    sudo node led.js

    .

  • ok, it works! :)

    does not work on desktop: Dell Vostro 3470
    and on a laptop: Lenovo v130 works ok

    can you close the topic - hardware fault?

Sign In or Register to comment.