码迷,mamicode.com
首页 > 其他好文 > 详细

部署prerender服务器

时间:2017-09-20 19:46:17      阅读:357      评论:0      收藏:0      [点我收藏+]

标签:erro   2.4   running   跳过   error:   UI   依赖   github   mod   

// 安装 git
sudo apt-get install git

sudo apt-get install curl // 请先确认服务器是否安装了curl 如果已经安装跳过即可

// 安装 node
curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
sudo apt-get install -y nodejs

sudo apt-get install -y build-essential

// 下载 prerender
git clone https://github.com/prerender/prerender

cd prerender

// 安装依赖包
npm i --registry https://registry.npm.taobao.org

// 启动
node server.js

// 如果遇到以下错误(后面两行提示的)
2016-12-31T19:57:42.231Z starting worker thread #0
2016-12-31T19:57:42.452Z starting phantom...
2016-12-31T19:57:42.460Z Server running on port 3000
/home/ubuntu/prerender/node_modules/.2.1.14@phantomjs-prebuilt/lib/phantom/bin/phantomjs: error while loading shared libraries: libfontconfig.so.1: cannot open shared object file: No such file or directory
(node:10992) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: /home/ubuntu/prerender/node_modules/.2.1.14@phantomjs-prebuilt/lib/phantom/bin/phantomjs: error while loading shared libraries: libfontconfig.so.1: cannot open shared object file: No such file or directory

// 修复方案
sudo apt-get install libfontconfig

// 启动成功
ubuntu@VM-0-110-ubuntu:~/prerender$ node server.js
2016-12-31T20:00:55.655Z starting worker thread #0
2016-12-31T20:00:55.865Z starting phantom...
2016-12-31T20:00:55.873Z Server running on port 3000
2016-12-31T20:00:56.491Z started phantom

部署prerender服务器

标签:erro   2.4   running   跳过   error:   UI   依赖   github   mod   

原文地址:http://www.cnblogs.com/liuzhenwei/p/7562900.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!