Linux安装gitbook

安装NodeJs

我选择直接下载当前的最新版node-v6.10.2-linux-x64.tar.xz,执行以下命令:
tar Jxvf node-v6.10.2-linux-x64.tar.xz
mv node-v6.10.2-linux-x64 /usr/local
ln -sf /usr/local/node-v6.10.2-linux-x64/bin/node /usr/local/bin/node
ln -sf /usr/local/node-v6.10.2-linux-x64/bin/npm /usr/local/bin/npm

安装gitbook

npm install -g gitbook-cli
ln -sf /usr/local/node-v6.10.2-linux-x64/bin/gitbook /usr/local/bin/gitbook

至此,gitbook安装成功!
附:一键安装脚本

#!/bin/bash
node_version_name="node-v6.10.2-linux-x64"
wget https://nodejs.org/dist/v6.10.2/$node_version_name.tar.xz
tar Jxvf $node_version_name.tar.xz
sudo mv $node_version_name /usr/local/

if [ ! -d "/usr/local/bin" ]; then
    sudo mkdir /usr/local/bin
fi

sudo ln -sf /usr/local/$node_version_name/bin/node /usr/local/bin/node
sudo ln -sf /usr/local/$node_version_name/bin/npm /usr/local/bin/npm

sudo npm install -g gitbook-cli
sudo ln -sf /usr/local/$node_version_name/bin/gitbook /usr/local/bin/gitbook
posted @ 2017-04-28 23:17  丐帮杨公子  阅读(...)  评论(...编辑  收藏