Tiny Core Linux

Tiny Core Base => Raspberry Pi => Topic started by: sicht on December 09, 2020, 02:41:39 PM

Title: Raspberry Pi node.js modules
Post by: sicht on December 09, 2020, 02:41:39 PM
Hi,
I am trying to access the raspberry pi hardware using node.js. W3schools has a nice examples for the full operating system. Node.js.tcz build is available but the npm onoff module, the pigpio module and socket.io module. are not available for as a tcz build.
If someone can help me create them or can steer me in the right direction that would be great.
The npn install sites are following
https://www.npmjs.com/package/onoff
https://www.npmjs.com/package/pigpio
https://www.npmjs.com/package/socket.io

Thanks!
Title: Re: Raspberry Pi node.js modules
Post by: Juanito on December 10, 2020, 05:01:47 AM
You can use the node.js package manager, npm, which is provided by the node.js extension.

For example:
Code: [Select]
$ tce-load -i compiletc python3.8 node.js
$ sudo npm install onoff

Note that this will install modules to /home/tc.

To install modules to /usr/local, you would have to set the copy2fs flag for node.js and install with "sudo npm -g"
Title: Re: Raspberry Pi node.js modules
Post by: sicht on December 22, 2020, 04:13:19 PM
Thanks for the prompt reply, been working on hardware and just got back to it.