摘自 reveal.js | Github

1. 快速开始

需要 Node.js 版本在4.0.0以上

> git clone https://github.com/hakimel/reveal.js.git
> cd reveal.js
reveal.js > npm install # 安装依赖

安装puppeteer@1.12.2时报错:

> puppeteer@1.12.2 install C:\Users\abel1\GithubProjects\reveal.js\node_modules\puppeteer
> node install.js

ERROR: Failed to download Chromium r624492! Set "PUPPETEER_SKIP_CHROMIUM_DOWNLOAD" env variable to skip download.

参见 ERROR: Failed to download Chromium | 简书,使用淘宝的npm源:

> npm config set puppeteer_download_host=https://npm.taobao.org/mirrors
> npm i puppeteer

或者使用淘宝的 cnpm,自动使用国内源:

> npm install -g cnpm --registry=https://registry.npm.taobao.org
> cnpm i puppeteer

启动Server

> cnpm start

再次报错,这次是node-sass

> reveal.js@3.8.0 start C:\Users\abel1\GithubProjects\reveal.js
> grunt serve

Loading "Gruntfile.js" tasks...ERROR
>> Error: ENOENT: no such file or directory, scandir 'C:\Users\abel1\GithubProjects\reveal.js\node_modules\node-sass\vendor'

重新构建node-sass

> cnpm rebuild node-sass

再次启动Server,成功:

$ cnpm start

> reveal.js@3.8.0 start C:\Users\abel1\GithubProjects\reveal.js
> grunt serve

Running "connect:server" (connect) task
Started connect web server on http://localhost:8000

Running "watch" task

未完待续…

参考文章

  1. reveal.js 官网
  2. reveal.js | Github
  3. Markdown - reveal.js | Github
  4. ERROR: Failed to download Chromium | 简书
  5. 淘宝 NPM 镜像 | cnpm
  6. Mirrors | cnpm