树莓派上配置electron记录

首先是最新版本的树莓派镜像默认不开启ssh,所以烧写好系统之后没法ssh登录

解决方法就是在烧写的内存卡分区内建立一个ssh文件(无后缀名),这样启动的时候就有ssh服务了

 

在~/.bashrc里面添加一个,alias ll='ls -a -l --color=auto',这样树莓派就支持ll命令了,这个是我个人喜好

 

然后更换源,这边用浙大的源,系统版本是jessie

deb http://mirrors.zju.edu.cn/raspbian/raspbian/ jessie main contrib non-free rpi
deb-src http://mirrors.zju.edu.cn/raspbian/raspbian/ jessie main contrib non-free rpi

 

然后安装node,具体查看我自己的博文

然后安装yarn

curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list

然后

# 克隆示例项目的仓库
$ git clone https://github.com/electron/electron-quick-start

# 进入这个仓库
$ cd electron-quick-start

# 安装依赖并运行
$ npm install && npm start

这里npm可以替换成为yarn

如果有错误的话

yarn config set registry https://registry.npm.taobao.org

这里使用淘宝镜像站就可以解决问题

posted @ 2018-01-27 20:32  鸡毛巾  阅读(1046)  评论(0编辑  收藏  举报