Download the latest binary package of Node version 6.10.3 LTS for armv7 from this link inside the directory /opt of your Acme board:
Uncompress it:
tar xvzf node-v6.10.3-linux-armv7l.tar.gz
Create two symbolic links to node and npm executable class='acmetable' files inside /usr/bin:
ln -s /opt/node-v6.10.3-linux-armv7l/bin/node /usr/bin/node ln -s /opt/node-v6.10.3-linux-armv7l/bin/npm /usr/bin/npm
Note is installed. Check the version by typing:
node --version v6.10.3
Save the node Hello World example code in a file called hello.js:
const http = require('http');
const hostname = '0.0.0.0';
const port = 3000;
const server = http.createServer((req, res) => {
res.statusCode = 200;
res.setHeader('Content-Type', 'text/plain');
res.end('Hello World\n');
});
server.listen(port, hostname, () => {
console.log(`Server running at http://${hostname}:${port}/`);
});
Then run it:
node hello.js
Open the web url http://acme_board_ip_address:3000 on your PC and to see the web server message generated by hello.js example.
Warning: Starting from NodeJS v4.0.0 the ARMv5 architecture is not supported so you can't use it on Arietta G25 and Aria G25
apt-get update apt-get install nodejs
show the nodejs version by typing:
nodejs --version v0.10.19
"Hello world !" example:
echo "console.log('Hello World !');" | nodejs
Hello World !
To install npm type:
apt-get install npm
Many thanks di Gianni Ruta for his contribute to this article