把玩Pencil项目之编译并运行

Pencil是个好项目。使用Electron做为运行环境,如同Vs Code同样,将JS跨平台桌面应用作了一个好的示范。我的很喜欢这种方式,毕竟多年来关注Web全栈开发,有一种JS一统天下的感受。个人运行环境是Mac book + vscode。git

  1. 首先是下载Pencil项目github

  2. 用vs code打开,运行npm i 安装依赖。这里遇到了第一个坑,权限问题,而且撞墙了。以下命令解决:npm

sudo npm install -g electron --unsafe-perm=true --allow-root --registry=https://registry.npm.taobao.org

  3. 安装成功后,npm start运行时遇到了第二个坑,控制的报错,bing后发现是electron的版本1.8.4有问题,因而uninstall,退回到1.7.8。结果安装了3此才成功electron

sudo npm install -g electron@1.7.8 --unsafe-perm=true --allow-root --registry=https://registry.npm.taobao.org

  4. npm start 终于运行成功了!开发模式启动能够使用以下命令:spa

npm run start:dev

 

   🙏打赏code

相关文章
相关标签/搜索