[SOLVED] Problem when running npm start to configure gateway

It looks like you’re running the yarn utility from the cmdtest package which is installed by default in ubuntu. While you could follow the steps in https://github.com/yarnpkg/yarn/issues/2821 to uninstall cmdtest and install yarn, it’s probably easiest to just run npm install in the gateway directory after which npm start should work

1 Like

Hello @hobinjk thank you for responding, I have proceeded in this way:

curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo “deb https://dl.yarnpkg.com/debian/ stable main” | sudo tee /etc/apt/sources.list.d/yarn.list
sudo apt update
sudo apt remove cmdtest
sudo apt install yarn

I get this result

root@d9lxc:~/gateway# npm install
npm WARN deprecated localhost.daplie.me-certificates@1.3.5: this package has been deprecated
npm WARN deprecated babel-preset-es2015@6.24.1: :raised_hands: Thanks for using Babel: we recommend using babel-preset-env now: please read babeljs.io/env to update!
npm WARN deprecated nomnom@1.8.1: Package no longer supported. Contact support@npmjs.com for more info.
npm ERR! Error while executing:
npm ERR! /usr/bin/git ls-remote -h -t https://github.com/mozilla-iot/gateway-addon-node.git
npm ERR!
npm ERR! fatal: Could not change back to ‘/root/gateway’: Permiso denegado
npm ERR!
npm ERR! exited with error code: 128

npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2018-04-20T02_29_39_346Z-debug.log

Hmm.

What user are you logged in as?
Where is that users home directory?
It looks like you’re logged in as root? (hence the # prompt)
Which distribution of linux are you using?
What are the permissions on the /root/gateway directory?

Our instructions are all based on being logged in as a non-root user. If you’re logged in as root, then you don’t need to use sudo, for example.

1 Like

Hello @dhylands thanks for answering
This is the data:

What user are you logged in as?
root
Where is that users home directory?
It looks like you’re logged in as root? (hence the # prompt)
yes
Which distribution of linux are you using?
debian 9
What are the permissions on the / root / gateway directory?
root@d9lxc:~# ls -l
drwxr-xr-x 11 root root 4096 abr 20 02:43 gateway

I have executed again command
npm test
this is the result:

root@d9lxc:~/gateway# npm test

things-gateway@0.4.0 test /root/gateway
npm run lint && npm run mocha

things-gateway@0.4.0 lint /root/gateway
eslint .

sh: 1: eslint: not found
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! things-gateway@0.4.0 lint: eslint .
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the things-gateway@0.4.0 lint 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! /root/.npm/_logs/2018-04-20T14_59_00_088Z-debug.log
npm ERR! Test failed. See above for more details.

delete npm and again say npm test

root@d9lxc:~/gateway# npm uninstall
up to date in 0.027s
root@d9lxc:~/gateway# npm install-test
npm WARN deprecated localhost.daplie.me-certificates@1.3.5: this package has been deprecated
npm WARN deprecated babel-preset-es2015@6.24.1: :raised_hands:now: please read babeljs.io/env to update!
npm WARN deprecated nomnom@1.8.1: Package no longer supported. Contact support@npmjs.com for more info.

sqlite3@4.0.0 install /root/gateway/node_modules/gateway-addon/node_modules/sqlite3
node-pre-gyp install --fallback-to-build

[sqlite3] Success: “/root/gateway/node_modules/gateway-addon/node_modules/sqlite3/lib/binding/node-v57-linux-x64/node_sqlite3.node” is installed via remote

ursa@0.9.4 install /root/gateway/node_modules/ursa
node-gyp rebuild

make: se entra en el directorio ‘/root/gateway/node_modules/ursa/build’
CXX(target) Release/obj.target/ursaNative/src/ursaNative.o
make: g++: No se encontró el programa
ursaNative.target.mk:97: fallo en las instrucciones para el objetivo ‘Release/obj.target/ursaNative/src/ursaNative.o’
make: *** [Release/obj.target/ursaNative/src/ursaNative.o] Error 127
make: se sale del directorio ‘/root/gateway/node_modules/ursa/build’
gyp ERR! build error
gyp ERR! stack Error: make failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/root/.nvm/versions/node/v8.11.1/lib/node_modules/npm/node_modules/npm-lifecycle/node_modules/node-gyp/lib/build.js:258: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.9.0-4-amd64
gyp ERR! command “/root/.nvm/versions/node/v8.11.1/bin/node” “/root/.nvm/versions/node/v8.11.1/lib/node_modules/npm/node_modules/npm-lifecycle/node_modules/node-gyp/bin/node-gyp.js” “rebuild”
gyp ERR! cwd /root/gateway/node_modules/ursa
gyp ERR! node -v v8.11.1
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok

nanomsg@4.0.2 install /root/gateway/node_modules/nanomsg
node-gyp rebuild

make: se entra en el directorio ‘/root/gateway/node_modules/nanomsg/build’
CC(target) Release/obj.target/nanomsg/deps/nanomsg/src/aio/ctx.o
CC(target) Release/obj.target/nanomsg/deps/nanomsg/src/aio/fsm.o
CC(target) Release/obj.target/nanomsg/deps/nanomsg/src/aio/pool.o
CC(target) Release/obj.target/nanomsg/deps/nanomsg/src/aio/timer.o
CC(target) Release/obj.target/nanomsg/deps/nanomsg/src/aio/timerset.o
CC(target) Release/obj.target/nanomsg/deps/nanomsg/src/aio/usock.o
CC(target) Release/obj.target/nanomsg/deps/nanomsg/src/aio/worker.o
CC(target) Release/obj.target/nanomsg/deps/nanomsg/src/core/ep.o
CC(target) Release/obj.target/nanomsg/deps/nanomsg/src/core/global.o
CC(target) Release/obj.target/nanomsg/deps/nanomsg/src/core/pipe.o
CC(target) Release/obj.target/nanomsg/deps/nanomsg/src/core/poll.o
CC(target) Release/obj.target/nanomsg/deps/nanomsg/src/core/sock.o
CC(target) Release/obj.target/nanomsg/deps/nanomsg/src/core/sockbase.o
CC(target) Release/obj.target/nanomsg/deps/nanomsg/src/core/symbol.o
CC(target) Release/obj.target/nanomsg/deps/nanomsg/src/devices/device.o
CC(target) Release/obj.target/nanomsg/deps/nanomsg/src/protocols/bus/bus.o
CC(target) Release/obj.target/nanomsg/deps/nanomsg/src/protocols/bus/xbus.o
CC(target) Release/obj.target/nanomsg/deps/nanomsg/src/protocols/pair/pair.o
CC(target) Release/obj.target/nanomsg/deps/nanomsg/src/protocols/pair/xpair.o
CC(target) Release/obj.target/nanomsg/deps/nanomsg/src/protocols/pipeline/pull.o
CC(target) Release/obj.target/nanomsg/deps/nanomsg/src/protocols/pipeline/push.o
CC(target) Release/obj.target/nanomsg/deps/nanomsg/src/protocols/pipeline/xpull.o
CC(target) Release/obj.target/nanomsg/deps/nanomsg/src/protocols/pipeline/xpush.o
CC(target) Release/obj.target/nanomsg/deps/nanomsg/src/protocols/pubsub/pub.o
CC(target) Release/obj.target/nanomsg/deps/nanomsg/src/protocols/pubsub/sub.o
CC(target) Release/obj.target/nanomsg/deps/nanomsg/src/protocols/pubsub/trie.o
CC(target) Release/obj.target/nanomsg/deps/nanomsg/src/protocols/pubsub/xpub.o
CC(target) Release/obj.target/nanomsg/deps/nanomsg/src/protocols/pubsub/xsub.o
CC(target) Release/obj.target/nanomsg/deps/nanomsg/src/protocols/reqrep/rep.o
CC(target) Release/obj.target/nanomsg/deps/nanomsg/src/protocols/reqrep/req.o
CC(target) Release/obj.target/nanomsg/deps/nanomsg/src/protocols/reqrep/task.o
CC(target) Release/obj.target/nanomsg/deps/nanomsg/src/protocols/reqrep/xrep.o
CC(target) Release/obj.target/nanomsg/deps/nanomsg/src/protocols/reqrep/xreq.o
CC(target) Release/obj.target/nanomsg/deps/nanomsg/src/protocols/survey/respondent.o
CC(target) Release/obj.target/nanomsg/deps/nanomsg/src/protocols/survey/surveyor.o
CC(target) Release/obj.target/nanomsg/deps/nanomsg/src/protocols/survey/xrespondent.o
CC(target) Release/obj.target/nanomsg/deps/nanomsg/src/protocols/survey/xsurveyor.o
CC(target) Release/obj.target/nanomsg/deps/nanomsg/src/protocols/utils/dist.o
CC(target) Release/obj.target/nanomsg/deps/nanomsg/src/protocols/utils/excl.o
CC(target) Release/obj.target/nanomsg/deps/nanomsg/src/protocols/utils/fq.o
CC(target) Release/obj.target/nanomsg/deps/nanomsg/src/protocols/utils/lb.o
CC(target) Release/obj.target/nanomsg/deps/nanomsg/src/protocols/utils/priolist.o
CC(target) Release/obj.target/nanomsg/deps/nanomsg/src/transports/inproc/binproc.o
CC(target) Release/obj.target/nanomsg/deps/nanomsg/src/transports/inproc/cinproc.o
CC(target) Release/obj.target/nanomsg/deps/nanomsg/src/transports/inproc/inproc.o
CC(target) Release/obj.target/nanomsg/deps/nanomsg/src/transports/inproc/ins.o
CC(target) Release/obj.target/nanomsg/deps/nanomsg/src/transports/inproc/msgqueue.o
CC(target) Release/obj.target/nanomsg/deps/nanomsg/src/transports/inproc/sinproc.o
CC(target) Release/obj.target/nanomsg/deps/nanomsg/src/transports/ipc/aipc.o
CC(target) Release/obj.target/nanomsg/deps/nanomsg/src/transports/ipc/bipc.o
CC(target) Release/obj.target/nanomsg/deps/nanomsg/src/transports/ipc/cipc.o
CC(target) Release/obj.target/nanomsg/deps/nanomsg/src/transports/ipc/ipc.o
CC(target) Release/obj.target/nanomsg/deps/nanomsg/src/transports/ipc/sipc.o
CC(target) Release/obj.target/nanomsg/deps/nanomsg/src/transports/tcp/atcp.o
CC(target) Release/obj.target/nanomsg/deps/nanomsg/src/transports/tcp/btcp.o
CC(target) Release/obj.target/nanomsg/deps/nanomsg/src/transports/tcp/ctcp.o
CC(target) Release/obj.target/nanomsg/deps/nanomsg/src/transports/tcp/stcp.o
CC(target) Release/obj.target/nanomsg/deps/nanomsg/src/transports/tcp/tcp.o
CC(target) Release/obj.target/nanomsg/deps/nanomsg/src/transports/utils/backoff.o
CC(target) Release/obj.target/nanomsg/deps/nanomsg/src/transports/utils/base64.o
CC(target) Release/obj.target/nanomsg/deps/nanomsg/src/transports/utils/dns.o
CC(target) Release/obj.target/nanomsg/deps/nanomsg/src/transports/utils/iface.o
CC(target) Release/obj.target/nanomsg/deps/nanomsg/src/transports/utils/literal.o
CC(target) Release/obj.target/nanomsg/deps/nanomsg/src/transports/utils/port.o
CC(target) Release/obj.target/nanomsg/deps/nanomsg/src/transports/utils/streamhdr.o
CC(target) Release/obj.target/nanomsg/deps/nanomsg/src/transports/ws/aws.o
CC(target) Release/obj.target/nanomsg/deps/nanomsg/src/transports/ws/bws.o
CC(target) Release/obj.target/nanomsg/deps/nanomsg/src/transports/ws/cws.o
CC(target) Release/obj.target/nanomsg/deps/nanomsg/src/transports/ws/sha1.o
CC(target) Release/obj.target/nanomsg/deps/nanomsg/src/transports/ws/sws.o
CC(target) Release/obj.target/nanomsg/deps/nanomsg/src/transports/ws/ws.o
CC(target) Release/obj.target/nanomsg/deps/nanomsg/src/transports/ws/ws_handshake.o
CC(target) Release/obj.target/nanomsg/deps/nanomsg/src/utils/alloc.o
CC(target) Release/obj.target/nanomsg/deps/nanomsg/src/utils/atomic.o
CC(target) Release/obj.target/nanomsg/deps/nanomsg/src/utils/chunk.o
CC(target) Release/obj.target/nanomsg/deps/nanomsg/src/utils/chunkref.o
CC(target) Release/obj.target/nanomsg/deps/nanomsg/src/utils/clock.o
CC(target) Release/obj.target/nanomsg/deps/nanomsg/src/utils/closefd.o
CC(target) Release/obj.target/nanomsg/deps/nanomsg/src/utils/condvar.o
CC(target) Release/obj.target/nanomsg/deps/nanomsg/src/utils/efd.o
CC(target) Release/obj.target/nanomsg/deps/nanomsg/src/utils/err.o
CC(target) Release/obj.target/nanomsg/deps/nanomsg/src/utils/hash.o
CC(target) Release/obj.target/nanomsg/deps/nanomsg/src/utils/list.o
CC(target) Release/obj.target/nanomsg/deps/nanomsg/src/utils/msg.o
CC(target) Release/obj.target/nanomsg/deps/nanomsg/src/utils/mutex.o
CC(target) Release/obj.target/nanomsg/deps/nanomsg/src/utils/once.o
CC(target) Release/obj.target/nanomsg/deps/nanomsg/src/utils/queue.o
CC(target) Release/obj.target/nanomsg/deps/nanomsg/src/utils/random.o
CC(target) Release/obj.target/nanomsg/deps/nanomsg/src/utils/sem.o
CC(target) Release/obj.target/nanomsg/deps/nanomsg/src/utils/sleep.o
CC(target) Release/obj.target/nanomsg/deps/nanomsg/src/utils/stopwatch.o
CC(target) Release/obj.target/nanomsg/deps/nanomsg/src/utils/strcasestr.o
CC(target) Release/obj.target/nanomsg/deps/nanomsg/src/utils/strncasecmp.o
CC(target) Release/obj.target/nanomsg/deps/nanomsg/src/utils/thread.o
CC(target) Release/obj.target/nanomsg/deps/nanomsg/src/utils/wire.o
CC(target) Release/obj.target/nanomsg/deps/nanomsg/src/aio/poller.o
AR(target) Release/obj.target/deps/nanomsg.a
COPY Release/nanomsg.a
CXX(target) Release/obj.target/node_nanomsg/src/node_nanomsg.o
make: g++: No se encontró el programa
node_nanomsg.target.mk:101: fallo en las instrucciones para el objetivo ‘Release/obj.target/node_nanomsg/src/node_nanomsg.o’
make: *** [Release/obj.target/node_nanomsg/src/node_nanomsg.o] Error 127
make: se sale del directorio ‘/root/gateway/node_modules/nanomsg/build’
gyp ERR! build error
gyp ERR! stack Error: make failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/root/.nvm/versions/node/v8.11.1/lib/node_modules/npm/node_modules/npm-lifecycle/node_modules/node-gyp/lib/build.js:258: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.9.0-4-amd64
gyp ERR! command “/root/.nvm/versions/node/v8.11.1/bin/node” “/root/.nvm/versions/node/v8.11.1/lib/node_modules/npm/node_modules/npm-lifecycle/node_modules/node-gyp/bin/node-gyp.js” “rebuild”
gyp ERR! cwd /root/gateway/node_modules/nanomsg
gyp ERR! node -v v8.11.1
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
npm WARN fsevents@1.2.0 had bundled packages that do not match the required version(s). They have been replaced with non-bundled versions.
npm WARN ajv-keywords@3.1.0 requires a peer of ajv@^6.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.0 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.0: wanted {“os”:“darwin”,“arch”:“any”} (current: {“os”:“linux”,“arch”:“x64”})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: ursa@0.9.4 (node_modules/ursa):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: ursa@0.9.4 install: node-gyp rebuild
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! nanomsg@4.0.2 install: node-gyp rebuild
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the nanomsg@4.0.2 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! /root/.npm/_logs/2018-04-20T15_51_34_889Z-debug.log

It looks like the error “npm ERR! fatal: Could not change back to ‘/root/gateway’: Permiso denegado” is npm doing strange things in response to running as root. I’d recommend downloading and running the gateway as a normal user

1 Like

This still boils down to the dependencies not being installed (eslint is a dependency which is installed by a successful run of npm install).

How much free space do you have?

1 Like

I understand I will enter as a normal user

I have a total of 106 GiB free

I just fired up a debian 9 virtual machine under VirtualBox using the minimal ISO, and I see a couple of dependencies are missing. Here are the commands I executed:

su
cd /root
apt install git
git clone https://github.mozilla-iot.org/gateway
apt install pkg-config
apt install curl
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.8/install.sh | bash
exit shell (i.e. Control-D)
re-enter shell (i.e. su)
cd /root
nvm install --lts
nvm use --lts
nvm alias default lts/*
apt install libusb-1.0-0-dev libudev-dev
git clone https://github.com/OpenZWave/open-zwave.git
apt install build-essential
cd open-zwave
make && make install
ldconfig
cd ..
npm install yarn --global
cd gateway
yarn
npm start

The key things that were missing were:

apt install git
apt install curl
apt install build-essential

You build was failing because g++ wasn’t installed. This will get installed if you install build-essential

1 Like

I’ve updated the README.md file to reflect the missing dependencies.

1 Like

perfect, thank you very much already install it

Well this makes me very happy! :grinning::beers:

I have used again
: ~ / gateway # npm install-test
this is the result

root@d9lxc:~/gateway# npm install-test
npm WARN ajv-keywords@3.1.0 requires a peer of ajv@^6.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.0 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.0: wanted {“os”:“darwin”,“arch”:“any”} (current: {“os”:“linux”,“arch”:“x64”})

added 113 packages from 75 contributors in 13.171s

things-gateway@0.4.0 test /root/gateway
npm run lint && npm run mocha

things-gateway@0.4.0 lint /root/gateway
eslint .

things-gateway@0.4.0 mocha /root/gateway
./src/test/run-tests.sh

Traceback (most recent call last):
File “”, line 1, in
ImportError: No module named adapt
./src/test/run-tests.sh: línea 13: pip: no se encontró la orden
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! things-gateway@0.4.0 mocha: ./src/test/run-tests.sh
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the things-gateway@0.4.0 mocha 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! /root/.npm/_logs/2018-04-20T17_48_20_180Z-debug.log
npm ERR! Test failed. See above for more details.

execute
:~/gateway# npm run debug --inspect
this is the result

root@d9lxc:~/gateway# npm run debug --inspect

things-gateway@0.4.0 debug /root/gateway
webpack && node --inspect build/gateway.js

(node:7651) DeprecationWarning: Tapable.plugin is deprecated. Use new API on .hooks instead

[at-loader] Using typescript@2.8.3 from typescript and “tsconfig.json” from /root/gateway/tsconfig.json.

[at-loader] Checking started in a separate process…

[at-loader] Ok, 0.659 sec.
Hash: ea3228f4ffa3cf74ce93
Version: webpack 4.6.0
Time: 3483ms
Built at: 2018-04-20 23:28:00
Asset Size Chunks Chunk Names
gateway.js 316 KiB main [emitted] main
gateway.js.map 353 KiB main [emitted] main
…/static/js/lib/stm_web.min.js 97.6 KiB [emitted]
Entrypoint main = gateway.js gateway.js.map
[./src/addon-manager.js] 33.5 KiB {main} [built]
[./src/app-instance.js] 1.18 KiB {main} [built]
[./src/app.js] 8.05 KiB {main} [built]
[./src/constants.js] 3.42 KiB {main} [built]
[./src/controllers/commands_controller.js] 6.01 KiB {main} [built]
[./src/db.js] 14.6 KiB {main} [built]
[./src/log-timestamps.js] 3.19 KiB {main} [built]
[./src/models/jsonwebtoken.js] 3.79 KiB {main} [built]
[./src/router.js] 4.86 KiB {main} [built]
[./src/rules-engine/index.js] 2.59 KiB {main} [built]
[express] external “express” 42 bytes {main} [built]
[https] external “https” 42 bytes {main} [built]
[mustache-express] external “mustache-express” 42 bytes {main} [built]
[node-getopt] external “node-getopt” 42 bytes {main} [built]
[path] external “path” 42 bytes {main} [built]
+ 111 hidden modules

WARNING in ./src/addon-manager.js
38:9-16 Critical dependency: require function is used in a way in which dependencies cannot be statically extracted
@ ./src/addon-manager.js
@ ./src/app.js
Debugger listening on ws://127.0.0.1:9229/067a1697-72f3-489f-9807-8e55cd6cb82e
For help see https://nodejs.org/en/docs/inspector
Error: Cannot find module ‘/root/gateway/node_modules/sqlite3/lib/binding/node-v57-linux-x64/node_sqlite3.node’
at Function.Module._resolveFilename (module.js:547:15)
at Function.Module._load (module.js:474:25)
at Module.require (module.js:596:17)
at require (internal/module.js:11:18)
at Object. (/root/gateway/node_modules/sqlite3/lib/sqlite3.js:4:15)
at Module._compile (module.js:652:30)
at Object.Module._extensions…js (module.js:663:10)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! things-gateway@0.4.0 debug: webpack && node --inspect build/gateway.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the things-gateway@0.4.0 debug 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! /root/.npm/_logs/2018-04-20T23_28_00_268Z-debug.log
root@d9lxc:~/gateway# npm install-test
npm WARN ajv-keywords@3.1.0 requires a peer of ajv@^6.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.0 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.0: wanted {“os”:“darwin”,“arch”:“any”} (current: {“os”:“linux”,“arch”:“x64”})

added 113 packages from 75 contributors in 12.929s

things-gateway@0.4.0 test /root/gateway
npm run lint && npm run mocha

things-gateway@0.4.0 lint /root/gateway
eslint .

things-gateway@0.4.0 mocha /root/gateway
./src/test/run-tests.sh

Traceback (most recent call last):
File “”, line 1, in
ImportError: No module named adapt
./src/test/run-tests.sh: línea 13: pip: no se encontró la orden
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! things-gateway@0.4.0 mocha: ./src/test/run-tests.sh
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the things-gateway@0.4.0 mocha 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! /root/.npm/_logs/2018-04-20T23_32_10_031Z-debug.log
npm ERR! Test failed. See above for more details.

I also added the following dependencies in order to get npm test to work:

apt install python-pip
apt install python3-pipnpm test
pip3 install git+https://github.com/mycroftai/adapt#egg=adapt-parser
cd
git clone https://github.com/mozilla-iot/intent-parser

And now, npm test gives:

Test Suites: 29 passed, 29 total
Tests:       291 passed, 291 total
Snapshots:   0 total
Time:        53.401s
Ran all test suites.
Killing intent parser pid 2009
root@debian:~/gateway#

And when I run npm run debug --inspect I see:

Debugger listening on ws://127.0.0.1:9229/976d1d7f-5a52-4168-a816-839a5cede7fd
For help see https://nodejs.org/en/docs/inspector
Opening database: /root/.mozilla-iot/config/db.sqlite3
2018-04-23 10:21:14.589 Listening on port 8080
2018-04-23 10:21:24.637 Checking for add-on updates...

You output shows:

Error: Cannot find module ‘/root/gateway/node_modules/sqlite3/lib/binding/node-v57-linux-x64/node_sqlite3.node’

which suggests missing dependencies

1 Like

:~/gateway# npm test

things-gateway@0.4.0 test /root/gateway
npm run lint && npm run mocha

things-gateway@0.4.0 lint /root/gateway
eslint .

things-gateway@0.4.0 mocha /root/gateway
./src/test/run-tests.sh

Already up-to-date.
socket binded to 5555
socket is listening
FAIL src/test/integration/things-test.js
● Test suite failed to run

Cannot find module '/root/gateway/node_modules/sqlite3/lib/binding/node-v57-linux-x64/node_sqlite3.node' from 'sqlite3.js'
  
  at Resolver.resolveModule (node_modules/jest-resolve/build/index.js:191:17)
  at Object.<anonymous> (node_modules/sqlite3/lib/sqlite3.js:4:15)

FAIL src/test/rules-engine/index-test.js
● Test suite failed to run

Cannot find module '/root/gateway/node_modules/sqlite3/lib/binding/node-v57-linux-x64/node_sqlite3.node' from 'sqlite3.js'
  
  at Resolver.resolveModule (node_modules/jest-resolve/build/index.js:191:17)
  at Object.<anonymous> (node_modules/sqlite3/lib/sqlite3.js:4:15)

FAIL src/test/integration/oauth-test.js
● Test suite failed to run

Cannot find module '/root/gateway/node_modules/sqlite3/lib/binding/node-v57-linux-x64/node_sqlite3.node' from 'sqlite3.js'
  
  at Resolver.resolveModule (node_modules/jest-resolve/build/index.js:191:17)
  at Object.<anonymous> (node_modules/sqlite3/lib/sqlite3.js:4:15)

FAIL src/test/integration/addons-test.js
● Test suite failed to run

Cannot find module '/root/gateway/node_modules/sqlite3/lib/binding/node-v57-linux-x64/node_sqlite3.node' from 'sqlite3.js'
  
  at Resolver.resolveModule (node_modules/jest-resolve/build/index.js:191:17)
  at Object.<anonymous> (node_modules/sqlite3/lib/sqlite3.js:4:15)

FAIL src/test/integration/actions-test.js
● Test suite failed to run

Cannot find module '/root/gateway/node_modules/sqlite3/lib/binding/node-v57-linux-x64/node_sqlite3.node' from 'sqlite3.js'
  
  at Resolver.resolveModule (node_modules/jest-resolve/build/index.js:191:17)
  at Object.<anonymous> (node_modules/sqlite3/lib/sqlite3.js:4:15)

FAIL src/test/integration/users-test.js
● Test suite failed to run

Cannot find module '/root/gateway/node_modules/sqlite3/lib/binding/node-v57-linux-x64/node_sqlite3.node' from 'sqlite3.js'
  
  at Resolver.resolveModule (node_modules/jest-resolve/build/index.js:191:17)
  at Object.<anonymous> (node_modules/sqlite3/lib/sqlite3.js:4:15)

FAIL src/test/integration/commands-test.js
● Test suite failed to run

Cannot find module '/root/gateway/node_modules/sqlite3/lib/binding/node-v57-linux-x64/node_sqlite3.node' from 'sqlite3.js'
  
  at Resolver.resolveModule (node_modules/jest-resolve/build/index.js:191:17)
  at Object.<anonymous> (node_modules/sqlite3/lib/sqlite3.js:4:15)

FAIL src/test/integration/updates-test.js
● Test suite failed to run

Cannot find module '/root/gateway/node_modules/sqlite3/lib/binding/node-v57-linux-x64/node_sqlite3.node' from 'sqlite3.js'
  
  at Resolver.resolveModule (node_modules/jest-resolve/build/index.js:191:17)
  at Object.<anonymous> (node_modules/sqlite3/lib/sqlite3.js:4:15)

FAIL src/test/integration/plugins-test.js
● Test suite failed to run

Cannot find module '/root/gateway/node_modules/sqlite3/lib/binding/node-v57-linux-x64/node_sqlite3.node' from 'sqlite3.js'
  
  at Resolver.resolveModule (node_modules/jest-resolve/build/index.js:191:17)
  at Object.<anonymous> (node_modules/sqlite3/lib/sqlite3.js:4:15)

FAIL src/test/integration/settings-test.js
● Test suite failed to run

Cannot find module '/root/gateway/node_modules/sqlite3/lib/binding/node-v57-linux-x64/node_sqlite3.node' from 'sqlite3.js'
  
  at Resolver.resolveModule (node_modules/jest-resolve/build/index.js:191:17)
  at Object.<anonymous> (node_modules/sqlite3/lib/sqlite3.js:4:15)

FAIL src/test/rules-engine/triggers-test.js
● Test suite failed to run

Cannot find module '/root/gateway/node_modules/sqlite3/lib/binding/node-v57-linux-x64/node_sqlite3.node' from 'sqlite3.js'
  
  at Resolver.resolveModule (node_modules/jest-resolve/build/index.js:191:17)
  at Object.<anonymous> (node_modules/sqlite3/lib/sqlite3.js:4:15)

FAIL src/test/integration/logs-test.js
● Test suite failed to run

Cannot find module '/root/gateway/node_modules/sqlite3/lib/binding/node-v57-linux-x64/node_sqlite3.node' from 'sqlite3.js'
  
  at Resolver.resolveModule (node_modules/jest-resolve/build/index.js:191:17)
  at Object.<anonymous> (node_modules/sqlite3/lib/sqlite3.js:4:15)

FAIL src/test/db-test.js
● Test suite failed to run

Cannot find module '/root/gateway/node_modules/sqlite3/lib/binding/node-v57-linux-x64/node_sqlite3.node' from 'sqlite3.js'
  
  at Resolver.resolveModule (node_modules/jest-resolve/build/index.js:191:17)
  at Object.<anonymous> (node_modules/sqlite3/lib/sqlite3.js:4:15)

FAIL src/test/integration/adapters-test.js
● Test suite failed to run

Cannot find module '/root/gateway/node_modules/sqlite3/lib/binding/node-v57-linux-x64/node_sqlite3.node' from 'sqlite3.js'
  
  at Resolver.resolveModule (node_modules/jest-resolve/build/index.js:191:17)
  at Object.<anonymous> (node_modules/sqlite3/lib/sqlite3.js:4:15)

FAIL src/test/rules-engine/effects-test.js
● Test suite failed to run

Cannot find module '/root/gateway/node_modules/sqlite3/lib/binding/node-v57-linux-x64/node_sqlite3.node' from 'sqlite3.js'
  
  at Resolver.resolveModule (node_modules/jest-resolve/build/index.js:191:17)
  at Object.<anonymous> (node_modules/sqlite3/lib/sqlite3.js:4:15)

FAIL src/test/models/jsonwebtoken-test.js
● Test suite failed to run

Cannot find module '/root/gateway/node_modules/sqlite3/lib/binding/node-v57-linux-x64/node_sqlite3.node' from 'sqlite3.js'
  
  at Resolver.resolveModule (node_modules/jest-resolve/build/index.js:191:17)
  at Object.<anonymous> (node_modules/sqlite3/lib/sqlite3.js:4:15)

FAIL src/test/integration/http-test.js
● Test suite failed to run

Cannot find module '/root/gateway/node_modules/sqlite3/lib/binding/node-v57-linux-x64/node_sqlite3.node' from 'sqlite3.js'
  
  at Resolver.resolveModule (node_modules/jest-resolve/build/index.js:191:17)
  at Object.<anonymous> (node_modules/sqlite3/lib/sqlite3.js:4:15)

FAIL src/test/passwords-test.js
● Test suite failed to run

Cannot find module '/root/gateway/node_modules/sqlite3/lib/binding/node-v57-linux-x64/node_sqlite3.node' from 'sqlite3.js'
  
  at Resolver.resolveModule (node_modules/jest-resolve/build/index.js:191:17)
  at Object.<anonymous> (node_modules/sqlite3/lib/sqlite3.js:4:15)

FAIL src/test/models/oauth-test.js
● Test suite failed to run

Cannot find module '/root/gateway/node_modules/sqlite3/lib/binding/node-v57-linux-x64/node_sqlite3.node' from 'sqlite3.js'
  
  at Resolver.resolveModule (node_modules/jest-resolve/build/index.js:191:17)
  at Object.<anonymous> (node_modules/sqlite3/lib/sqlite3.js:4:15)

FAIL src/test/integration/uploads-test.js
● Test suite failed to run

Cannot find module '/root/gateway/node_modules/sqlite3/lib/binding/node-v57-linux-x64/node_sqlite3.node' from 'sqlite3.js'
  
  at Resolver.resolveModule (node_modules/jest-resolve/build/index.js:191:17)
  at Object.<anonymous> (node_modules/sqlite3/lib/sqlite3.js:4:15)

FAIL src/test/models/settings-test.js
● Test suite failed to run

Cannot find module '/root/gateway/node_modules/sqlite3/lib/binding/node-v57-linux-x64/node_sqlite3.node' from 'sqlite3.js'
  
  at Resolver.resolveModule (node_modules/jest-resolve/build/index.js:191:17)
  at Object.<anonymous> (node_modules/sqlite3/lib/sqlite3.js:4:15)

Summary of all failing tests
FAIL src/test/integration/things-test.js
● Test suite failed to run

Cannot find module '/root/gateway/node_modules/sqlite3/lib/binding/node-v57-linux-x64/node_sqlite3.node' from 'sqlite3.js'
  
  at Resolver.resolveModule (node_modules/jest-resolve/build/index.js:191:17)
  at Object.<anonymous> (node_modules/sqlite3/lib/sqlite3.js:4:15)

FAIL src/test/rules-engine/index-test.js
● Test suite failed to run

Cannot find module '/root/gateway/node_modules/sqlite3/lib/binding/node-v57-linux-x64/node_sqlite3.node' from 'sqlite3.js'
  
  at Resolver.resolveModule (node_modules/jest-resolve/build/index.js:191:17)
  at Object.<anonymous> (node_modules/sqlite3/lib/sqlite3.js:4:15)

FAIL src/test/integration/oauth-test.js
● Test suite failed to run

Cannot find module '/root/gateway/node_modules/sqlite3/lib/binding/node-v57-linux-x64/node_sqlite3.node' from 'sqlite3.js'
  
  at Resolver.resolveModule (node_modules/jest-resolve/build/index.js:191:17)
  at Object.<anonymous> (node_modules/sqlite3/lib/sqlite3.js:4:15)

FAIL src/test/integration/addons-test.js
● Test suite failed to run

Cannot find module '/root/gateway/node_modules/sqlite3/lib/binding/node-v57-linux-x64/node_sqlite3.node' from 'sqlite3.js'
  
  at Resolver.resolveModule (node_modules/jest-resolve/build/index.js:191:17)
  at Object.<anonymous> (node_modules/sqlite3/lib/sqlite3.js:4:15)

FAIL src/test/integration/actions-test.js
● Test suite failed to run

Cannot find module '/root/gateway/node_modules/sqlite3/lib/binding/node-v57-linux-x64/node_sqlite3.node' from 'sqlite3.js'
  
  at Resolver.resolveModule (node_modules/jest-resolve/build/index.js:191:17)
  at Object.<anonymous> (node_modules/sqlite3/lib/sqlite3.js:4:15)

FAIL src/test/integration/users-test.js
● Test suite failed to run

Cannot find module '/root/gateway/node_modules/sqlite3/lib/binding/node-v57-linux-x64/node_sqlite3.node' from 'sqlite3.js'
  
  at Resolver.resolveModule (node_modules/jest-resolve/build/index.js:191:17)
  at Object.<anonymous> (node_modules/sqlite3/lib/sqlite3.js:4:15)

FAIL src/test/integration/commands-test.js
● Test suite failed to run

Cannot find module '/root/gateway/node_modules/sqlite3/lib/binding/node-v57-linux-x64/node_sqlite3.node' from 'sqlite3.js'
  
  at Resolver.resolveModule (node_modules/jest-resolve/build/index.js:191:17)
  at Object.<anonymous> (node_modules/sqlite3/lib/sqlite3.js:4:15)

FAIL src/test/integration/updates-test.js
● Test suite failed to run

Cannot find module '/root/gateway/node_modules/sqlite3/lib/binding/node-v57-linux-x64/node_sqlite3.node' from 'sqlite3.js'
  
  at Resolver.resolveModule (node_modules/jest-resolve/build/index.js:191:17)
  at Object.<anonymous> (node_modules/sqlite3/lib/sqlite3.js:4:15)

FAIL src/test/integration/plugins-test.js
● Test suite failed to run

Cannot find module '/root/gateway/node_modules/sqlite3/lib/binding/node-v57-linux-x64/node_sqlite3.node' from 'sqlite3.js'
  
  at Resolver.resolveModule (node_modules/jest-resolve/build/index.js:191:17)
  at Object.<anonymous> (node_modules/sqlite3/lib/sqlite3.js:4:15)

FAIL src/test/integration/settings-test.js
● Test suite failed to run

Cannot find module '/root/gateway/node_modules/sqlite3/lib/binding/node-v57-linux-x64/node_sqlite3.node' from 'sqlite3.js'
  
  at Resolver.resolveModule (node_modules/jest-resolve/build/index.js:191:17)
  at Object.<anonymous> (node_modules/sqlite3/lib/sqlite3.js:4:15)

FAIL src/test/rules-engine/triggers-test.js
● Test suite failed to run

Cannot find module '/root/gateway/node_modules/sqlite3/lib/binding/node-v57-linux-x64/node_sqlite3.node' from 'sqlite3.js'
  
  at Resolver.resolveModule (node_modules/jest-resolve/build/index.js:191:17)
  at Object.<anonymous> (node_modules/sqlite3/lib/sqlite3.js:4:15)

FAIL src/test/integration/logs-test.js
● Test suite failed to run

Cannot find module '/root/gateway/node_modules/sqlite3/lib/binding/node-v57-linux-x64/node_sqlite3.node' from 'sqlite3.js'
  
  at Resolver.resolveModule (node_modules/jest-resolve/build/index.js:191:17)
  at Object.<anonymous> (node_modules/sqlite3/lib/sqlite3.js:4:15)

FAIL src/test/db-test.js
● Test suite failed to run

Cannot find module '/root/gateway/node_modules/sqlite3/lib/binding/node-v57-linux-x64/node_sqlite3.node' from 'sqlite3.js'
  
  at Resolver.resolveModule (node_modules/jest-resolve/build/index.js:191:17)
  at Object.<anonymous> (node_modules/sqlite3/lib/sqlite3.js:4:15)

FAIL src/test/integration/adapters-test.js
● Test suite failed to run

Cannot find module '/root/gateway/node_modules/sqlite3/lib/binding/node-v57-linux-x64/node_sqlite3.node' from 'sqlite3.js'
  
  at Resolver.resolveModule (node_modules/jest-resolve/build/index.js:191:17)
  at Object.<anonymous> (node_modules/sqlite3/lib/sqlite3.js:4:15)

FAIL src/test/rules-engine/effects-test.js
● Test suite failed to run

Cannot find module '/root/gateway/node_modules/sqlite3/lib/binding/node-v57-linux-x64/node_sqlite3.node' from 'sqlite3.js'
  
  at Resolver.resolveModule (node_modules/jest-resolve/build/index.js:191:17)
  at Object.<anonymous> (node_modules/sqlite3/lib/sqlite3.js:4:15)

FAIL src/test/models/jsonwebtoken-test.js
● Test suite failed to run

Cannot find module '/root/gateway/node_modules/sqlite3/lib/binding/node-v57-linux-x64/node_sqlite3.node' from 'sqlite3.js'
  
  at Resolver.resolveModule (node_modules/jest-resolve/build/index.js:191:17)
  at Object.<anonymous> (node_modules/sqlite3/lib/sqlite3.js:4:15)

FAIL src/test/integration/http-test.js
● Test suite failed to run

Cannot find module '/root/gateway/node_modules/sqlite3/lib/binding/node-v57-linux-x64/node_sqlite3.node' from 'sqlite3.js'
  
  at Resolver.resolveModule (node_modules/jest-resolve/build/index.js:191:17)
  at Object.<anonymous> (node_modules/sqlite3/lib/sqlite3.js:4:15)

FAIL src/test/passwords-test.js
● Test suite failed to run

Cannot find module '/root/gateway/node_modules/sqlite3/lib/binding/node-v57-linux-x64/node_sqlite3.node' from 'sqlite3.js'
  
  at Resolver.resolveModule (node_modules/jest-resolve/build/index.js:191:17)
  at Object.<anonymous> (node_modules/sqlite3/lib/sqlite3.js:4:15)

FAIL src/test/models/oauth-test.js
● Test suite failed to run

Cannot find module '/root/gateway/node_modules/sqlite3/lib/binding/node-v57-linux-x64/node_sqlite3.node' from 'sqlite3.js'
  
  at Resolver.resolveModule (node_modules/jest-resolve/build/index.js:191:17)
  at Object.<anonymous> (node_modules/sqlite3/lib/sqlite3.js:4:15)

FAIL src/test/integration/uploads-test.js
● Test suite failed to run

Cannot find module '/root/gateway/node_modules/sqlite3/lib/binding/node-v57-linux-x64/node_sqlite3.node' from 'sqlite3.js'
  
  at Resolver.resolveModule (node_modules/jest-resolve/build/index.js:191:17)
  at Object.<anonymous> (node_modules/sqlite3/lib/sqlite3.js:4:15)

FAIL src/test/models/settings-test.js
● Test suite failed to run

Cannot find module '/root/gateway/node_modules/sqlite3/lib/binding/node-v57-linux-x64/node_sqlite3.node' from 'sqlite3.js'
  
  at Resolver.resolveModule (node_modules/jest-resolve/build/index.js:191:17)
  at Object.<anonymous> (node_modules/sqlite3/lib/sqlite3.js:4:15)

Test Suites: 21 failed, 21 total
Tests: 0 total
Snapshots: 0 total
Time: 2.382s
Ran all test suites.
Killing intent parser pid 14756
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! things-gateway@0.4.0 mocha: ./src/test/run-tests.sh
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the things-gateway@0.4.0 mocha 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! /root/.npm/_logs/2018-04-29T16_20_09_804Z-debug.log
npm ERR! Test failed. See above for more details.

:~/gateway# nano /root/.npm/_logs/2018-04-29T16_20_09_804Z-debug.log

0 info it worked if it ends with ok
1 verbose cli [ ‘/root/.nvm/versions/node/v8.11.1/bin/node’,
1 verbose cli ‘/root/.nvm/versions/node/v8.11.1/bin/npm’,
1 verbose cli ‘run’,
1 verbose cli ‘mocha’ ]
2 info using npm@5.8.0
3 info using node@v8.11.1
4 verbose run-script [ ‘premocha’, ‘mocha’, ‘postmocha’ ]
5 info lifecycle things-gateway@0.4.0~premocha: things-gateway@0.4.0
6 info lifecycle things-gateway@0.4.0~mocha: things-gateway@0.4.0
7 verbose lifecycle things-gateway@0.4.0~mocha: unsafe-perm in lifecycle true
8 verbose lifecycle things-gateway@0.4.0~mocha: PATH: /root/.nvm/versions/node/v8.11.1/lib/node_modules/npm/node_modules/npm-lifecy$
9 verbose lifecycle things-gateway@0.4.0~mocha: CWD: /root/gateway
10 silly lifecycle things-gateway@0.4.0~mocha: Args: [ ‘-c’, ‘./src/test/run-tests.sh’ ]
11 silly lifecycle things-gateway@0.4.0~mocha: Returned: code: 1 signal: null
12 info lifecycle things-gateway@0.4.0~mocha: Failed to exec mocha script
13 verbose stack Error: things-gateway@0.4.0 mocha: ./src/test/run-tests.sh
13 verbose stack Exit status 1
13 verbose stack at EventEmitter. (/root/.nvm/versions/node/v8.11.1/lib/node_modules/npm/node_modules/npm-lifecycle/$
13 verbose stack at emitTwo (events.js:126:13)
13 verbose stack at EventEmitter.emit (events.js:214:7)
13 verbose stack at ChildProcess. (/root/.nvm/versions/node/v8.11.1/lib/node_modules/npm/node_modules/npm-lifecycle/$
13 verbose stack at emitTwo (events.js:126:13)
13 verbose stack at ChildProcess.emit (events.js:214:7)
13 verbose stack at maybeClose (internal/child_process.js:925:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
14 verbose pkgid things-gateway@0.4.0
15 verbose cwd /root/gateway
16 verbose Linux 4.9.0-4-amd64
17 verbose argv “/root/.nvm/versions/node/v8.11.1/bin/node” “/root/.nvm/versions/node/v8.11.1/bin/npm” “run” “mocha”
18 verbose node v8.11.1
19 verbose npm v5.8.0
20 error code ELIFECYCLE
21 error errno 1
22 error Exit status 1
23 error Failed at the things-gateway@0.4.0 mocha script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]

I think you already have a solution.
npm install-test which you executed breaks node packages which installed by yarn.
Probably, you could start gateway by installing from the beginning with correct processes.

With this log we can only tell you something is wrong with the environment, and we need many questions and answers to solve the problem. This will be difficult via the Internet.

In the case of such an environment problem, it is difficult to receive correct advice unless you isolate the problem yourself.

1 Like

I understand how complicated it is to work in this way.
Here I work with a Debian 9 minimal server machine that is different from the Github machine you refer to.
The Github is a Debian 9 minimal server machine installed only for gateway.
I will try again on another one starting from scratch.
Thank you very much for all the help.

result after installing in new Debian 9 minimal server

:~/gateway$ npm test

Test Suites: 2 failed, 29 passed, 31 total
Tests: 2 failed, 292 passed, 294 total
Snapshots: 0 total
Time: 69.164s, estimated 178s
Ran all test suites.
Killing intent parser pid 15667
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! things-gateway@0.4.0 mocha: ./src/test/run-tests.sh
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the things-gateway@0.4.0 mocha 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/iot/.npm/_logs/2018-05-05T12_23_14_067Z-debug.log
npm ERR! Test failed. See above for more details.

Congratulations! it seems to success install dependencies.
2 failed tests are maybe the browser tests.
If you want to run tests completely, install Firefox.

Additionally we need install openjdk-8-jre in order to run browser tests.

1 Like