Setup the development environment
Setup development environment
- Set up NodeJS 8 LTS and npm
- First, to make things clean: sudo apt-get update
- You can't install Node using apt-get; try it to see the error if you like.
- You can install directly from ARMv6 binaries on the Node site.
- cd ~/Downloads
- wget https://nodejs.org/dist/v8.11.3/node-v8.11.3-linux-armv6l.tar.xz
- tar -xvf node-v8.11.3-linux-armv6l.tar.xz
- cd node-v8.11.3-linux-armv6l
- sudo cp -R bin include lib share /usr/local/
- `which node` --version
- Now logout and login again.
- Set up git
- Git already exists on the Pi so just update it to the latest.
- sudo apt-get install git
- Add in missing packages we'll need for BLE
- These system packages are prerequisites of noble npm package for BLE:
- sudo apt-get install bluetooth bluez libbluetooth-dev libudev-dev
- May also want to run BLE manipulation as non-root user, so we need setcap:
- sudo apt-get install libcap2-bin
- Then we can run it:
- sudo setcap cap_net_raw+eip $(eval readlink -f `which node`)
Comments
Post a Comment