准备工作
/* git, npm, nodejs工具准备 */
/* Linux下安装指令 */
sudo apt-get install npm
sudo apt-get install nodejs
sudo apt-get install git
/* 对版本要求较高,需升级 */
npm install -g npm /* npm升级到最新版本 */
npm install -g n /* nodejs升级 */
n stable /* 升级到最新的稳定版本 */
一、下载scratch 源代码
下载地址:https://github.com/LLK/scratch-gui

二、编译
cd 下载的路径
npm install
// 进入到下载的文件夹下scratch-gui-develop
cd scratch-gui-develop
// 编译
npm install

安装的时候报错
Please check if you have git installed and in your PATH.
意思就是没安装git,因为需要到git下载一些东西,所以需要安装git,容易,到下面的地址去下载对应的git,安装即可
git安装地址:https://git-scm.com/downloads

三、导出编译后的文件,index.html及相关文件
npm run build
导出成功后,你可以在看到根目录里面多了一个build文件,里面都是导出的相关文件,直接点开index.html
可以直接访问项目

打开index.html
在根目录,build里面的index文件,打开它即可 scratch-gui-develop/build/index.html

网友评论