Scratch 3.0 as a standalone desktop application
Follow the steps below to set up and build Scratch Desktop on your system.
Use the following commands to install Node.js version 16 using NVM:
To build reliably use Node 16.20.0
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
nvm install 16
Clone the Scratch Desktop repository and navigate into the project directory:
git clone https://github.com/Teakzieas/scratch-desktop.git
cd scratch-desktop
The following operations are performed by the Pi configuration script:
-- Enable I2C on Pi
-- Resize the Swap File to 2048 MB (in case a 4GB Pi does not have enough memory to build)
-- Install Java (required for google-closure-compiler)
-- Install Ruby and FPM (required for electron-builder to export)
npm run Piconfig
Install the required packages using the following command:
npm install --unsafe-perm
To start the application, use the following command:
npm run start
To build the application, execute the following commands:
export USE_SYSTEM_FPM="true"
NODE_OPTIONS=--max-old-space-size=4096 npm run dist:rpi64
build results are stored in Dist folder, .deb file
If you've made changes to StemHat files in the ScratchVM
or ScratchGUI
, save them with the following commands:
npm run Stemhat:save
git add -A
git commit -m "Your commit message"
git push
- Ensure that I2C is enabled on the Raspberry Pi.
- This setup was tested on a Raspberry Pi 4GB running Raspberry Pi OS 64-bit.