Cannot install serialport module with npm

I installed nodejs with the instructions here . Then I try to install serialport module but it can not install it. The error that I took is here :

root@colibri-imx6:~/nodeapp# npm install serialport
-
> serialport@2.0.5 install /home/root/nodeapp/node_modules/serialport
> node-pre-gyp install --fallback-to-build

make: Entering directory '/home/root/nodeapp/node_modules/serialport/build'
  CXX(target) Release/obj.target/serialport/src/serialport.o
make: g++: Command not found
serialport.target.mk:88: recipe for target 'Release/obj.target/serialport/src/serialport.o' failed
make: *** [Release/obj.target/serialport/src/serialport.o] Error 127
make: Leaving directory '/home/root/nodeapp/node_modules/serialport/build'
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/home/root/nodeapp/node_modules/node-gyp/lib/build.js:276:23)
gyp ERR! stack     at ChildProcess.emit (events.js:98:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:820:12)
gyp ERR! System Linux 3.10.17
gyp ERR! command "/usr/bin/node" "/home/root/nodeapp/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--module=/home/root                                                                                               /nodeapp/node_modules/serialport/build/Release/node-v11-linux-arm/serialport.node" "--module_name=serialport" "--module_path=/home/root/nodeap                                                                                               p/node_modules/serialport/build/Release/node-v11-linux-arm"
gyp ERR! cwd /home/root/nodeapp/node_modules/serialport
gyp ERR! node -v v0.10.35
gyp ERR! node-gyp -v v3.2.1
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute '/usr/bin/node /home/root/nodeapp/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-b                                                                                               uild --module=/home/root/nodeapp/node_modules/serialport/build/Release/node-v11-linux-arm/serialport.node --module_name=serialport --module_pa                                                                                               th=/home/root/nodeapp/node_modules/serialport/build/Release/node-v11-linux-arm' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/home/root/nodeapp/node_modules/serialport/node_modules/node-pre-gyp/lib/util/compile                                                                                               .js:83:29)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:98:17)
node-pre-gyp ERR! stack     at maybeClose (child_process.js:766:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:833:5)
node-pre-gyp ERR! System Linux 3.10.17
node-pre-gyp ERR! command "node" "/home/root/nodeapp/node_modules/serialport/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /home/root/nodeapp/node_modules/serialport
node-pre-gyp ERR! node -v v0.10.35
node-pre-gyp ERR! node-pre-gyp -v v0.6.13
node-pre-gyp ERR! not ok
Failed to execute '/usr/bin/node /home/root/nodeapp/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/home/root/nodeap                                                                                               p/node_modules/serialport/build/Release/node-v11-linux-arm/serialport.node --module_name=serialport --module_path=/home/root/nodeapp/node_modu                                                                                               les/serialport/build/Release/node-v11-linux-arm' (1)

npm ERR! serialport@2.0.5 install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the serialport@2.0.5 install script.
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! System Linux 3.10.17
npm ERR! command "node" "/usr/bin/npm" "install" "serialport"
npm ERR! cwd /home/root/nodeapp
npm ERR! node -v v0.10.35
npm ERR! npm -v 1.4.28
npm ERR! code ELIFECYCLE
npm ERR! not ok code 0
root@colibri-imx6:~/nodeapp#

Hi

It looks like the installer tries to natively compile some C++ code but cannot find the required tools.
You probably already did install additional packages, e.g. make because the build fails when calling g++.

On a freshly installed V2.4 module I get:

opkg install nodejs nodejs-npm
npm install serialport

.

> serialport@2.0.5 install /home/root/node_modules/serialport
> node-pre-gyp install --fallback-to-build

gyp ERR! build error
gyp ERR! stack Error: not found: make

Installling the build essentials for native compilation works for me.

opkg install packagegroup-sdk-target

.

root@colibri-imx6:~# npm install serialport

> serialport@2.0.5 install /home/root/node_modules/serialport
> node-pre-gyp install --fallback-to-build

make: Entering directory '/home/root/node_modules/serialport/build'
  CXX(target) Release/obj.target/serialport/src/serialport.o
  ...
  TOUCH Release/obj.target/action_after_build.stamp
make: Leaving directory '/home/root/node_modules/serialport/build'
serialport@2.0.5 node_modules/serialport
─ bindings@1.2.1
...
─ nan@2.0.9                                                             
root@colibri-imx6:~#

Note that I did not test the resulting serialport module.