Install a few handy packages using apt you might not need these, but I find them necessary for many of my projects.
sudo apt update
sudo apt install build-essential libavahi-compat-libdnssd-dev git
Remove any outdated copies of Node.js – you might have a node installation on your Pi already. Still, chances are it’s not the one you want.
sudo apt install node- npm-
- apt will uninstall a package when you follow its name with a -
sudo apt autoremove#this will clean out unused packages Once things are cleaned up, install the Node Version Manager, NVM:
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.37.2/install.sh | bashMake sure to exit and relaunch your terminal. Install the latest NodeLTSRelease
nvm install --lts nvm use --ltsInstall the Yarn dependency manager, which we’ll use to run our app:
npm install --global yarn
That’s it – easy, when you have everything in place! With Node and Yarn fully setup, you can get started with doing local Dev and Quality assurance of projects that are powered by Node.