Need some help installing nodejs, npm, and brickpi-raspberry (for Lego robotics)

The Raspberry Pi is a series of credit card-sized single-board computers developed in the United Kingdom by the Raspberry Pi Foundation to promote the teaching of basic computer science in schools and developing countries.

Post Reply
User avatar
/RaspberryPi
Corporate
Posts: 2449
Joined: Wed Jun 05, 2019 1:29 am

Need some help installing nodejs, npm, and brickpi-raspberry (for Lego robotics)

Post by /RaspberryPi »

I have a Pi 2 running Raspbian Legacy (Debian 10 "Buster"), with a BrickPi unit attached to it so that I can use Lego motors and sensors. It works with Python, but I'd like to get it to work with NodeJS.
I installed NodeJS and NPM (apt install nodejs npm) and that appears to have been successful. But when I run npm install brickpi-raspberry it first says npm does not support Node.js v10.24.0, which is odd; why would it have installed a version of npm that doesn't work with the nodejs it installed at the same time? (I later tried uninstalling npm, but nodejs doesn't come with its own npm.)
npm then gave me a bunch of deprecated warnings, followed by node-pre-gyp telling me it couldn’t find pre-built binaries for serialport and it tried to build from source but failed after numerous compiler errors.
Do I need to install specific versions of nodejs and npm to work with the brickpi-raspberry package? (and if so, how do I do that?)

submitted by /u/bkendig
[link] [comments]

More...
Post Reply

Return to “Raspberry Pi Forum”