[SOLVED] Error when I start node script

Hello

Who can help me.
It looks like the installaition is not jet succefull.

ik get this error

pi@raspberrypi:~/matrix-os $ NODE_ENV=rc node index.js
Environment Selected: rc
Loading Core Matrix Files
Loading… device
Loading… event
Loading… service
module.js:583
return process.dlopen(module, path._makeLong(filename));
^

Error: Module version mismatch. Expected 48, got 46.
at Error (native)
at Object.Module._extensions…node (module.js:583:18)
at Module.load (module.js:473:32)
at tryModuleLoad (module.js:432:12)
at Function.Module._load (module.js:424:3)
at Module.require (module.js:483:17)
at require (internal/module.js:20:19)
at Object. (/home/pi/matrix-os/node_modules/grpc/src/node/src/grpc_extension.js:38:15)
at Module._compile (module.js:556:32)
at Object.Module._extensions…js (module.js:565:10)

What did I did wrong?
Did i missed an installation step?

Hey @Greenfield,

This seems like a NodeJS version issue. We’ve tested up to NodeJS 6.5 with no issues. We do receive this issue when attempting to initialize the platform on NodeJS 6.8 (package issue, we’re waiting on the updates).

Can you run node -v to see what node version? Here’s how to configure a specific node version.

# install npm to install the node version manager globally
sudo apt-get install npm


# n is a node version manager
sudo npm install -g n


# node 6.5 is the latest target node version, also installs new `npm`.
n 6.5

Please let me know if you need additional assistance here.

Should “n 6.5” require sudo? It fails for me:

$ n 6.5
mkdir: cannot create directory ‘/usr/local/n’: Permission denied
mkdir: cannot create directory ‘/usr/local/n’: Permission denied

     install : node-v6.5.0
     mkdir : /usr/local/n/versions/node/6.5.0
mkdir: cannot create directory ‘/usr/local/n’: Permission denied

  Error: sudo required

Replying to my own post. Two things needed to address the above -

  1. I wasn’t in group ‘staff’ (sudo adduser me staff)
  2. Some directories needed to be made group-writable (sudo chmod -R g+w blah-blah)

Hello brianofadmobilize

I have version 6.5.0
I remove folderts and with tool rimraf, and also delete the node_modules dir.

An try it again with no good result

pi@raspberrypi:~/matrix-os $ ls -ltr /home/pi/matrix-os/node_modules
ls: cannot access /home/pi/matrix-os/node_modules: No such file or directory
pi@raspberrypi:~/matrix-os $ sudo npm install -g n
(node:11903) fs: re-evaluating native module sources is not supported. If you are using the graceful-fs module, please update it to a more recent version.
(node:11903) fs: re-evaluating native module sources is not supported. If you are using the graceful-fs module, please update it to a more recent version.
(node:11903) fs: re-evaluating native module sources is not supported. If you are using the graceful-fs module, please update it to a more recent version.
(node:11903) fs: re-evaluating native module sources is not supported. If you are using the graceful-fs module, please update it to a more recent version.
(node:11903) fs: re-evaluating native module sources is not supported. If you are using the graceful-fs module, please update it to a more recent version.
(node:11903) fs: re-evaluating native module sources is not supported. If you are using the graceful-fs module, please update it to a more recent version.
(node:11903) fs: re-evaluating native module sources is not supported. If you are using the graceful-fs module, please update it to a more recent version.
(node:11903) fs: re-evaluating native module sources is not supported. If you are using the graceful-fs module, please update it to a more recent version.
(node:11903) fs: re-evaluating native module sources is not supported. If you are using the graceful-fs module, please update it to a more recent version.
/usr/local/bin/n -> /usr/local/lib/node_modules/n/bin/n
/usr/local/lib
└── n@2.1.4

pi@raspberrypi:~/matrix-os $ n 6.5
pi@raspberrypi:~/matrix-os $ ls -ltr /home/pi/matrix-os/node_modules
ls: cannot access /home/pi/matrix-os/node_modules: No such file or directory
pi@raspberrypi:~/matrix-os $ ls *.sh
docker-entrypoint.sh start_node.sh
pi@raspberrypi:~/matrix-os $ more start_node.sh
NODE_ENV=rc node index.js
pi@raspberrypi:~/matrix-os $ . start_node.sh
module.js:457
throw err;
^

Error: Cannot find module 'lodash’
at Function.Module._resolveFilename (module.js:455:15)
at Function.Module._load (module.js:403:25)
at Module.require (module.js:483:17)
at require (internal/module.js:20:19)
at Object. (/home/pi/matrix-os/index.js:4:5)
at Module._compile (module.js:556:32)
at Object.Module._extensions…js (module.js:565:10)
at Module.load (module.js:473:32)
at tryModuleLoad (module.js:432:12)
at Function.Module._load (module.js:424:3)

I set back a backup and dit reinstall.

It looks like a old node version is stalled

pi@raspberrypi:~ $ node -v
v0.10.29

I can I do an nieuw installation.

Again this error;

pi@raspberrypi:~ $ sudo apt-get install -y libzmq3-dev xc3sprog malos-eye matrix-creator-malos matrix-creator-openocd wiringpi matrix-creator-init cmake g++ git --force-yes;
Reading package lists… Done
Building dependency tree
Reading state information… Done
E: Unable to locate package xc3sprog
E: Unable to locate package malos-eye
E: Unable to locate package matrix-creator-malos
E: Unable to locate package matrix-creator-openocd
E: Unable to locate package matrix-creator-init

futher on I get this

npm ERR! Linux 4.4.22-v7+
npm ERR! argv “/usr/local/bin/node” “/usr/local/bin/npm” "install"
npm ERR! node v6.5.0
npm ERR! npm v3.10.3
npm ERR! code ELIFECYCLE

npm ERR! zmq@2.15.3 install: node-gyp rebuild
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the zmq@2.15.3 install script ‘node-gyp rebuild’.
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 zmq package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp rebuild
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs zmq
npm ERR! Or if that isn’t available, you can get their info via:
npm ERR! npm owner ls zmq
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR! /home/pi/matrix-os/npm-debug.log

can you mak a youtube install video?
I get lost

1 Like

Or is there a image i can download?

Hey @greenfield we’ll make a video shortly. The error that you appear to be getting is because there is a missing zeromq dependency. You can circumvent this by running apt-get install libzmq3-dev. This is documented in the install process here as well: Overview MATRIX

after install of the lib get same error.
Do I have to login in?
Can I also set my password? is ther an option?
I copyed the .env file of the last installation, does that also possible?

pi@raspberrypi:~ $ sudo \apt-get install libzmq3-dev
Reading package lists… Done
Building dependency tree
Reading state information… Done
The following packages were automatically installed and are no longer required:
gyp libavahi-client-dev libavahi-common-dev libc-ares-dev libcaca-dev libdbus-1-dev libdirectfb-extra libfftw3-double3 libflite1 libgme0 libgtkglext1 libjbig-dev libjs-node-uuid liblzma-dev libmimic0
libmjpegutils-2.1-0 libmms0 libmpeg2encpp-2.1-0 libmpg123-0 libmplex2-2.1-0 libofa0 libopencv-flann2.4 libopencv-ml2.4 libopencv-photo2.4 libopencv-video2.4 libpulse-dev libpulse-mainloop-glib0 libsbc1
libsdl2-2.0-0 libslang2-dev libsoundtouch0 libspandsp2 libsrtp0 libtiffxx5 libv8-3.14-dev libv8-3.14.5 libvo-aacenc0 libvo-amrwbenc0 libwayland-egl1-mesa libwebcam0 libwebrtc-audio-processing-0
libwildmidi-config libwildmidi1 libzbar0 node-abbrev node-ansi node-ansi-color-table node-archy node-async node-block-stream node-combined-stream node-cookie-jar node-delayed-stream node-forever-agent
node-form-data node-fstream node-fstream-ignore node-github-url-from-git node-glob node-graceful-fs node-gyp node-inherits node-ini node-json-stringify-safe node-lockfile node-lru-cache node-mime
node-minimatch node-mkdirp node-mute-stream node-node-uuid node-nopt node-normalize-package-data node-npmlog node-once node-osenv node-qs node-read node-read-package-json node-request node-retry
node-rimraf node-semver node-sha node-sigmund node-slide node-tar node-tunnel-agent node-underscore node-which rtkit uvcdynctrl uvcdynctrl-data
Use ‘apt-get autoremove’ to remove them.
The following extra packages will be installed:
libpgm-5.1-0 libsodium13 libzmq3
The following NEW packages will be installed:
libpgm-5.1-0 libsodium13 libzmq3 libzmq3-dev
0 upgraded, 4 newly installed, 0 to remove and 3 not upgraded.
Need to get 1,263 kB of archives.
After this operation, 2,609 kB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Get:1 http://mirrordirector.raspbian.org/raspbian/ jessie/main libsodium13 armhf 1.0.0-1 [143 kB]
Get:2 http://mirrordirector.raspbian.org/raspbian/ jessie/main libpgm-5.1-0 armhf 5.1.118-1~dfsg-1 [153 kB]
Get:3 http://mirrordirector.raspbian.org/raspbian/ jessie/main libzmq3 armhf 4.0.5+dfsg-2+deb8u1 [418 kB]
Get:4 http://mirrordirector.raspbian.org/raspbian/ jessie/main libzmq3-dev armhf 4.0.5+dfsg-2+deb8u1 [549 kB]
Fetched 1,263 kB in 3s (407 kB/s)
Selecting previously unselected package libsodium13:armhf.
(Reading database … 154445 files and directories currently installed.)
Preparing to unpack …/libsodium13_1.0.0-1_armhf.deb …
Unpacking libsodium13:armhf (1.0.0-1) …
Selecting previously unselected package libpgm-5.1-0.
Preparing to unpack …/libpgm-5.1-0_5.1.118-1~dfsg-1_armhf.deb …
Unpacking libpgm-5.1-0 (5.1.118-1~dfsg-1) …
Selecting previously unselected package libzmq3:armhf.
Preparing to unpack …/libzmq3_4.0.5+dfsg-2+deb8u1_armhf.deb …
Unpacking libzmq3:armhf (4.0.5+dfsg-2+deb8u1) …
Selecting previously unselected package libzmq3-dev:armhf.
Preparing to unpack …/libzmq3-dev_4.0.5+dfsg-2+deb8u1_armhf.deb …
Unpacking libzmq3-dev:armhf (4.0.5+dfsg-2+deb8u1) …
Processing triggers for man-db (2.7.0.2-5) …
Setting up libsodium13:armhf (1.0.0-1) …
Setting up libpgm-5.1-0 (5.1.118-1~dfsg-1) …
Setting up libzmq3:armhf (4.0.5+dfsg-2+deb8u1) …
Setting up libzmq3-dev:armhf (4.0.5+dfsg-2+deb8u1) …
Processing triggers for libc-bin (2.19-18+deb8u6) …
pi@raspberrypi:~ $ NODE_ENV=rc node index.js
module.js:457
throw err;
^

Error: Cannot find module '/home/pi/index.js’
at Function.Module._resolveFilename (module.js:455:15)
at Function.Module._load (module.js:403:25)
at Module.runMain (module.js:590:10)
at run (bootstrap_node.js:394:7)
at startup (bootstrap_node.js:149:9)
at bootstrap_node.js:509:3

This is a rpi2 shell I by a 3 and do clean install?

I have a new clea rpi3.
I wil note the steps, if I get error again I wil post it.

Hey @Greenfield sorry for the late response, missed this. Make sure when you clone the directory that you cd into the appropriate matrix-os directory.

I believe this was a typo in our docs. We corrected it:

git clone https://github.com/matrix-io/matrix-os.git;
cd matrix-os;
git submodule update --init;
npm install;

Please let us know if you have any additional issues!

Oke have a clean instllation, wil try this steps.

Oke found the matrix setup youtube movie.
Great!