引言
小孩处于求知欲特别旺盛的时期,是时候开始播撒编程的种子。男孩子就要做那些酷酷的事情。
先上效果图
源代码地址
https://github.com/scratchfoundation/scratch-gui.git
https://github.com/scratchfoundation/scratch-desktop.git
环境配置
启动任务
Ctrl+Shift+P
显示库安装路径
npm list -g --depth 0
npm install
npm start
网路错误
npm error code 1 npm error path D:\LinuxWorkSpace\scratch-desktop\node_modules\electron npm error command failed npm error command C:\WINDOWS\system32\cmd.exe /d /s /c node install.js npm error Debugger listening on ws://127.0.0.1:59754/e8d2be43-6dd4-45a3-a456-a95bb191fa4b npm error For help, see: https://nodejs.org/en/docs/inspector npm error Debugger attached. npm error ReadError: The server aborted pending request npm error at IncomingMessage.<anonymous> (D:\LinuxWorkSpace\scratch-desktop\node_modules\got\dist\source\core\index.js:809:31) npm error at Object.onceWrapper (node:events:632:28) npm error at IncomingMessage.emit (node:events:530:35) npm error at origin.emit (D:\LinuxWorkSpace\scratch-desktop\node_modules\@szmarczak\http-timer\dist\source\index.js:43:20) npm error at IncomingMessage._destroy (node:_http_incoming:221:10) npm error at _destroy (node:internal/streams/destroy:122:10) npm error at IncomingMessage.destroy (node:internal/streams/destroy:84:5) npm error at TLSSocket.socketCloseListener (node:_http_client:478:11) npm error at TLSSocket.emit (node:events:530:35) npm error at node:net:346:12 npm error Waiting for the debugger to disconnect... npm error A complete log of this run can be found in: C:\Users\HiMaq\AppData\Local\npm-cache\_logs\2025-08-18T03_21_51_368Z-debug-0.log Waiting for the debugger to disconnect...
# 全局设置 npm 镜像为淘宝源
npm config set registry "https://registry.npmmirror.com/"
# 环境配置
npm config set proxy http://127.0.0.1:7890
npm config set https-proxy http://127.0.0.1:7890
npm config get https-proxy
npm config get proxy
curl -x http://127.0.0.1:7890 https://registry.npmmirror.com/
npm config list
npm install --proxy http://127.0.0.1:7890 --https-proxy http://127.0.0.1:7890
npm cache clean --force
npm config set registry https://registry.npmmirror.com/
# 全局安装进度显示工具
npm install -g npm-install-progress
# 使用该工具执行安装
npm-install-progress install
# 手动下载
https://github.abskoop.workers.dev/https://github.com/electron/electron/releases/download/v25.9.8/electron-v25.9.8-win32-x64.zip
# 关闭调试模式并启动
node --inspect=false scripts/start.js
# 显示安装进度
npm install -g cnpm --registry=https://registry.npmmirror.com
# cnpm
cnpm config set progress true
# 版本检测
D:\LinuxWorkSpace\scratch-desktop>npx electron --version
v25.9.8
解决国区下载失败错误
解决编译错误
https://github.com/scratchfoundation/scratch-gui/issues/9012
打包windows程序
https://blog.csdn.net/weixin_42409913/article/details/103877621
核心指令
# 关闭npm的严格校验(临时解决完整性问题)
npm config set strict-ssl false
npm install
npm run start
npm link scratch-gui
npm run build-gui
npm start
npm run dist
游戏源码
https://www.codewizardshq.com/25-best-scratch-games/
https://blog.csdn.net/weixin_42409913/article/details/103877621⭐⭐⭐⭐⭐