WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Raspberry Pi node.js modules  (Read 1705 times)

Offline sicht

  • Newbie
  • *
  • Posts: 10
Raspberry Pi node.js modules
« 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!

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14851
Re: Raspberry Pi node.js modules
« Reply #1 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"

Offline sicht

  • Newbie
  • *
  • Posts: 10
Re: Raspberry Pi node.js modules
« Reply #2 on: December 22, 2020, 04:13:19 PM »
Thanks for the prompt reply, been working on hardware and just got back to it.