Win10 scratch3 2d buglist


#1

一、创建你的第一个Scratch3.0 Extension

https://blog.just4fun.site/create-first-Scratch3-Extension.html

  1. Installation Problem: Unexpected token { in cli.js
    nodejs 用最新版本安装

  2. info There appears to be trouble with your network connection. Retrying…
    改变镜像:yarn config set registry https://registry.npm.taobao.org

  3. npm install 安装慢 更换淘宝镜像
    npm config set registry https://registry.npm.taobao.org

  4. github git 慢
    https://www.jianshu.com/p/0493dcc15d6f
    https://www.ipaddress.com/

140.82.114.3 github.com
151.101.185.194 github.global.ssl.fastly.net
更改 hosts 重新刷新dns

D:\cmder\Scratch3
λ ipconfig /flushdns
Windows IP 配置
已成功刷新 DNS 解析缓存。

二、编译scratch3.0桌面程序(根据原创进行了一点修改)
https://blog.csdn.net/weixin_43513495/article/details/88633957

参考github 原始文档

cd scratch-gui (转到scratch-gui目录)
git clone HYPERLINK HYPERLINK https://github.com/LLK/scratch-desktop https://github.com/LLK/scratch-desktop HYPERLINK https://github.com/LLK/scratch-desktop https://github.com/LLK/scratch-desktop
npm install
yarn
yarn build
yarn start
用上句开启服务器 登录网址为HYPERLINK HYPERLINK http://127.0.0.1:8601 http://127.0.0.1:8601 HYPERLINK http://127.0.0.1:8601 http://127.0.0.1:8601
可以用词句开启运行webpack-dev-server --https,打开:HYPERLINK HYPERLINK https://127.0.0.1:8601/ https://127.0.0.1:8601/ HYPERLINK https://127.0.0.1:8601/ https://127.0.0.1:8601/ 如果开启正常scratch3回到cmder进行下一步
ctrl+c 关闭服务器
set BUILD_MODE=dist 7.1)set STATIC_PATH=static
npm run build (犯了个错误 build后面加了个空格 出现 npm err!missing script:build 去掉后正常)
cd scratch-desktop
yarn
npm install
npm run fetch
将scratch-gui下面的dist拷贝到 scratch-desktop/node_modules/scratch-gui/
npm start
npm run dist //制作打包的版本
或者 npm run dist:dir //模拟打包就是半打包


如果上面npm 安装运行问题, 使用下面yarn的方式

scratch-desktop

配置好命令环境
windows用户
安装nodejs.
使用cmder,而不是cmd。
以下为cmder 命令
node -v # v10.15.0. v11.7.0也没问题 , 推荐使用n来管理nodejs版本
npm install -g yarn
npm install -g webpack
npm install -g webpack-dev-server
mkdir Scratch3 #
cd Scratch3
git clone https://github.com/LLK/scratch-gui
cd scratch-gui
yarn install

找不到资源
D:\cmder\scratch
λ git checkout scratch-gui
fatal: not a git repository (or any of the parent directories): .git

从原始地址克隆
D:\cmder\Scratch3
λ git clone https://github.com/LLK/scratch-gui.git
Cloning into ‘scratch-gui’…
remote: Enumerating objects: 65, done.
remote: Counting objects: 100% (65/65), done.
remote: Compressing objects: 100% (57/57), done.
remote: Total 68200 (delta 31), reused 19 (delta 8), pack-reused 68135
Receiving objects: 100% (68200/68200), 1.03 GiB | 2.50 MiB/s, done.
Resolving deltas: 100% (50408/50408), done.
Checking out files: 100% (809/809), done.

切换分支
D:\cmder\Scratch3\scratch-gui (develop -> origin) (scratch-gui@0.1.0)
λ git checkout scratch-desktop
Switched to a new branch ‘scratch-desktop’
Branch ‘scratch-desktop’ set up to track remote branch ‘scratch-desktop’ from ‘origin’.

安装依赖文件
D:\cmder\Scratch3\scratch-gui (scratch-desktop -> origin) (scratch-gui@0.1.0)
λ yarn install

yarn link

set BUILD_MODE=dist
set STATIC_PATH=static
yarn build
cd…
git clone https://github.com/LLK/scratch-desktop.git
cd scratch-desktop
yarn install
yarn link scratch-gui
npm run fetch
yarn start
yarn run dist

参考
https://blog.just4fun.site/create-first-Scratch3-Extension.html
https://blog.csdn.net/weixin_43513495/article/details/88633957

制作一个插件
注意日文翻译后代码是添加了空格,原网页复制才能保证路径文件名正确。