- 下载源码:https://github.com/LLK/scratch-www
- 进入目录:cd scratch-www
- 安装npm:sudo apt install npm
- 更新依赖包:npm install
- 报错:node-sass@4.6.1 install:`node scripts/install.js`
- 原因:node没安装
- 安装nodejs:sudo apt install nodejs-legacy
- 重新执行:npm installBuild:npm run build
5.报错:Block-scoped declarations (let..) not yet supported outside strict mode
原因:node不是最新的
升级nodejs到最新:
安装工具n:sudo npm install n -g
安装lts版本:sudo n lts
重启终端
重新执行:npm run build
报错:Node Sass does not yet support your current environment: Linux 64-bit with Unsupported runtime(64)
原因:系统不支持
https://github.com/sass/node-sass/releases/tag/v4.6.1(sass支持的node版本)
发现是node sass和node不兼容,当前版本是4.6.1支持最高的node是9,上一步升级的node到了10.13.0
降级nodejs到9:sudo n 9.11.2(因为代码中显示依赖sass4.6.1,因此尝试安装node9的最高版本9.11.2)
重启终端
重新执行:npm run build
报错:Node Sass could not find a binding for you current environment: Linux 64-bit with Node.js 9.x
Found bindings for the following environments:
Linux 64-bit with Node.js 4.x
原因:node更新后没有修改sass中的绑定
重新编译sass:npm rebuild node-sass --force
重新执行:npm run build
6.Run:启动
make translations
npm start
7.当上面运行得到:Server listening on port 8333,表示启动成功
查看结果:查看本地scratch内容
- 本机访问http://localhost:8333
- 局域网访问http://192.168.3.155:8333(服务器IP地址)
---------------------
作者:suoxd123
来源:优快云
原文:https://blog.youkuaiyun.com/suoxd123/article/details/84563583
版权声明:本文为博主原创文章,转载请附上博文链接!