[SOLVED] Problem when running npm start to configure gateway

Hi, I’m installing on Debian 9 minimal server

I’m in the step of running npm to configure the gateway

root@d9lxc:~/gateway# npm start

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

sh: 1: webpack: 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 start: webpack && node build/gateway.js
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the things-gateway@0.4.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?

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

Hi,

I think that you forget Installing dependencies.

Quote from README.md

  • Install dependencies:

NOTE: yarn is preferred but npm install will also work. To install yarn run npm install --global yarn or for a more secure installation follow the directions for your OS.

$ yarn
1 Like

Hello @sogaani thanks for answering
I have now installed dependencies

root@d9lxc:~/gateway# npm install --global yarn
/root/.nvm/versions/node/v8.11.1/bin/yarn -> /root/.nvm/versions/node/v8.11.1/lib/node_modules/yarn/bin/yarn.js
/root/.nvm/versions/node/v8.11.1/bin/yarnpkg -> /root/.nvm/versions/node/v8.11.1/lib/node_modules/yarn/bin/yarn.js
+yarn@1.6.0
added 1 package in 21.178s

run npm start again and this is the result

root@d9lxc:~/gateway# npm start

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

sh: 1: webpack: 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 start: webpack && node build/gateway.js
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the things-gateway@0.4.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?

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

Now that you’ve installed yarn, run it from within the gateway directory and it will install all of the gateway dependencies.

1 Like

hello @dhylands thanks for answering
I have executed yarm
this is the result

root@d9lxc:~/gateway# yarn
ERROR: There are no scenarios; must have at least one.

am i running correctly yarn?

I used the ls command to show directories and files that I have in the / gatwey directory

root@d9lxc:~/gateway# ls
config
cross-compile.sh
doc
global.d.ts
image
install.sh
LICENSE
package.json
pagekite.py
README.md
run-app.sh
src
tatic
tools
tsconfig.json
webpack.config.js
yarn.lock

I used the test command in npm 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 WARN Local package.json exists, but node_modules missing, did you mean to install?

npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2018-04-20T01_23_30_035Z-debug.log
npm ERR! Test failed. See above for more details.

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