About node.js version

which node.js version am I use on toradex board ? I use colibri imx6 and linux os.

node versions are here

I use latest version but ı could not install serial port please help me about this selection …

best regards . . .

Try check this post, maybe it will be useful: Cannot install serialport module with npm - Technical Support - Toradex Community

root@colibri-imx6:~/serport# npm install serialport --save
npm WARN package.json serport@1.0.0 No description
npm WARN package.json serport@1.0.0 No repository field.
npm WARN package.json serport@1.0.0 No README data
/
> serialport@2.0.6 install /home/root/serport/node_modules/serialport
> node-pre-gyp install --fallback-to-build

Traceback (most recent call last):
  File "/usr/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py", line 15, in <module>
    import gyp
  File "/usr/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 8, in <module>
    import gyp.input
  File "/usr/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/input.py", line 5, in <module>
    from compiler.ast import Const
ImportError: No module named compiler.ast
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:343:16)
gyp ERR! stack     at ChildProcess.emit (events.js:110:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:1074:12)
gyp ERR! System Linux 3.14.28-dirty
gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "--fallback-to-build" "--module=/home/root/serport/node_modules/serialport/build/Release/node-v14-linux-arm/serialport.node" "--module_name=serialport" "--module_path=/home/root/serport/node_modules/serialport/build/Release/node-v14-linux-arm"
gyp ERR! cwd /home/root/serport/node_modules/serialport
gyp ERR! node -v v0.12.2
gyp ERR! node-gyp -v v1.0.3
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute '/usr/bin/node /usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/home/root/serport/node_modules/serialport/build/Release/node-v14-linux-arm/serialport.node --module_name=serialport --module_path=/home/root/serport/node_modules/serialport/build/Release/node-v14-linux-arm' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/home/root/serport/node_modules/serialport/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:110:17)
node-pre-gyp ERR! stack     at maybeClose (child_process.js:1015:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:1087:5)
node-pre-gyp ERR! System Linux 3.14.28-dirty
node-pre-gyp ERR! command "node" "/home/root/serport/node_modules/serialport/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /home/root/serport/node_modules/serialport
node-pre-gyp ERR! node -v v0.12.2
node-pre-gyp ERR! node-pre-gyp -v v0.6.18
node-pre-gyp ERR! not ok
Failed to execute '/usr/bin/node /usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/home/root/serport/node_modules/serialport/build/Release/node-v14-linux-arm/serialport.node --module_name=serialport --module_path=/home/root/serport/node_modules/serialport/build/Release/node-v14-linux-arm' (1)
npm ERR! Linux 3.14.28-dirty
npm ERR! argv "node" "/usr/bin/npm" "install" "serialport" "--save"
npm ERR! node v0.12.2
npm ERR! npm  v2.7.4
npm ERR! code ELIFECYCLE

npm ERR! serialport@2.0.6 install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the serialport@2.0.6 install script 'node-pre-gyp install --fallback-to-build'.
npm ERR! This is most likely a problem with the serialport 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 their info via:
npm ERR!     npm owner ls serialport
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /home/root/serport/npm-debug.log
root@colibri-imx6:~/serport#

ı take this error. ı am already install

opkg install packagegroup-sdk-target

ı reset my board use sd card image than ı run this commands.

opkg update
opkg install nano
opkg install packagegroup-sdk-target
opkg install python-compiler
opkg install python-misc
opkg install python-multiprocessing
opkg install python-distutils
opkg install python-setuptools
opkg install python-simplejson
opkg install python-subprocess
opkg install python-fcntl
opkg install python-modules
opkg install python
opkg install task-sdk-native




opkg update
opkg install gcc
opkg install gcc-symlinks
opkg install g++
opkg install g++-symlinks
opkg install make
opkg install boost
opkg install libc6-dev
opkg install binutils
opkg files libgcc-s-dev

after this installations than install this nodejs for armv7

than create a directory nodeap

mkdir nodeap
cd nodeap
touch app.js
npm init --yes
npm install serialport --save

than ı take an errors :

root@colibri-imx6:~/nodeap# npm install serialport --save
npm WARN package.json nodeap@1.0.0 No description
npm WARN package.json nodeap@1.0.0 No repository field.
npm WARN package.json nodeap@1.0.0 No README data
\
> serialport@2.0.6 install /home/root/nodeap/node_modules/serialport
> node-pre-gyp install --fallback-to-build

make: Entering directory '/home/root/nodeap/node_modules/serialport/build'
  CXX(target) Release/obj.target/serialport/src/serialport.o
In file included from /home/root/.node-gyp/4.4.0/include/node/uv.h:48:0,
                 from ../node_modules/nan/nan.h:23,
                 from ../src/serialport.h:5,
                 from ../src/serialport.cpp:3:
/home/root/.node-gyp/4.4.0/include/node/uv-errno.h:25:19: fatal error: errno.h: No such file or directory
 #include <errno.h>
                   ^
compilation terminated.
serialport.target.mk:90: recipe for target 'Release/obj.target/serialport/src/serialport.o' failed
make: *** [Release/obj.target/serialport/src/serialport.o] Error 1
make: Leaving directory '/home/root/nodeap/node_modules/serialport/build'
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/opt/node/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:276:23)
gyp ERR! stack     at emitTwo (events.js:87:13)
gyp ERR! stack     at ChildProcess.emit (events.js:172:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Linux 3.14.28-dirty
gyp ERR! command "/opt/node/bin/node" "/opt/node/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--module=/home/root/nodeap/node_modules/serialport/build/Release/node-v46-linux-arm/serialport.node" "--module_name=serialport" "--module_path=/home/root/nodeap/node_modules/serialport/build/Release/node-v46-linux-arm"
gyp ERR! cwd /home/root/nodeap/node_modules/serialport
gyp ERR! node -v v4.4.0
gyp ERR! node-gyp -v v3.3.0
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute '/opt/node/bin/node /opt/node/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/home/root/nodeap/node_modules/serialport/build/Release/node-v46-linux-arm/serialport.node --module_name=serialport --module_path=/home/root/nodeap/node_modules/serialport/build/Release/node-v46-linux-arm' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/home/root/nodeap/node_modules/serialport/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack     at emitTwo (events.js:87:13)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:172:7)
node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:827:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
node-pre-gyp ERR! System Linux 3.14.28-dirty
node-pre-gyp ERR! command "/opt/node/bin/node" "/home/root/nodeap/node_modules/serialport/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /home/root/nodeap/node_modules/serialport
node-pre-gyp ERR! node -v v4.4.0
node-pre-gyp ERR! node-pre-gyp -v v0.6.18
node-pre-gyp ERR! not ok
Failed to execute '/opt/node/bin/node /opt/node/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/home/root/nodeap/node_modules/serialport/build/Release/node-v46-linux-arm/serialport.node --module_name=serialport --module_path=/home/root/nodeap/node_modules/serialport/build/Release/node-v46-linux-arm' (1)
npm ERR! Linux 3.14.28-dirty
npm ERR! argv "/opt/node/bin/node" "/usr/bin/npm" "install" "serialport" "--save"
npm ERR! node v4.4.0
npm ERR! npm  v2.14.20
npm ERR! code ELIFECYCLE

npm ERR! serialport@2.0.6 install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the serialport@2.0.6 install script 'node-pre-gyp install --fallback-to-build'.
npm ERR! This is most likely a problem with the serialport 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 serialport
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!
npm ERR!     npm owner ls serialport
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /home/root/nodeap/npm-debug.log
root@colibri-imx6:~/nodeap#

Somehow you’re not being able to compile serialport module for arm. If you didn’t solve this yet, you can cross-compile it on your host machine and pass the module to your board.

To cross compile the module for arm:

  • install the same node and npm version on your host
  • install a cross-platform compiler (gcc-linaro for example)
  • set evironment variables (CC, CROSS_COMPILE etc.)
  • export CPPDEFINES = ‘NACL_BUILD_ARCH=arm’
  • run “npm install serialport --target_arch=arm” on host
  • transfer serialport module to your target