1.安装

git clone https://github.com/LLK/scratch-gui.git
cd scratch-gui
npm install

2.启动

npm start

3.访问

http://localhost:8601/

4.注意事项
在ubantu18中自带的Node8中安装,npm时候会报错,将nodejs升级到14后一切正常
阿里云需要在安全组中开启8601端口

5.在node 10.19.0中安装
npm i后会提示缺少webpack-dev-server,手动安装
npm start启动无报错,打开页面却提示Invalid Host header
问题原因:新版的webpack-dev-server增加了安全验证,默认检查hostname,如果hostname不是配置内的,将中断访问。在scratch-gui文件夹下webpack.base,config.js中找到devserver,添加{disableHostCheck: true}
此处也可以修改端口

参考链接:https://github.com/LLK/scratch-gui

作者 铁血 汉子 2020年8月16日
2024/04/20/01:49:00am 2020/8/16/11:56:01
0 1078