ubuntu14.04下搭建hexo个人博客

ubuntu下搭建hexo个人博客

Hexo install

0. update & upgrade system packages

First, ensure the system packages are up to date


sudo apt-get update && sudo apt-get upgrade

Second, if you want to create a repostory on github, you should install Git.

sudo apt-get install git

1. install node.js

Install node.js using nvm(node.js version manager)

1. Install essential environment lib

sudo apt-get install build-essential libssl-dev


2. Pull down the nvm installation script from the nvm's GitHub page and install nvm

using cURL:


curl https://raw.github.com/creationix/nvm/master/install.sh | sh

using Wget:


 wget -qO- https://raw.github.com/creationix/nvm/master/install.sh | sh



or download zip file and unzip

unzip -o nvm-master.zip 

cd nvm-master

./install.sh

3. Then update profile
source ~/.profile

4. Install node.js

Find out the versions of Node.js that are available for installation

nvm ls-remote

        ......
         v6.5.0
         v6.6.0
         v6.7.0
         v6.8.0
         v6.8.1
         v6.9.0   (LTS: Boron)
         v6.9.1   (LTS: Boron)
         v6.9.2   (LTS: Boron)
         v6.9.3   (LTS: Boron)
         v6.9.4   (LTS: Boron)
         v6.9.5   (LTS: Boron)
         v6.10.0   (LTS: Boron)
         v6.10.1   (Latest LTS: Boron)
         v7.0.0
        ......

As we see, the Latest LTS is 6.10.1, we can install that and explicitly declare the use version is 6.10.1

nvm install 6.10.1
nvm use 6.10.1

If you have multiple Node.js versions, you can see what is installed by typing:

nvm ls

If you wish to default one of the versions, you can type:

nvm alias default 6.10.1 

This version will be automatically selected when a new session spawnss. You can also reference it by the alias like this:

nvm use default

2. Install hexo

Using the npm(node.js package manager) to install hexo.

1. Install hexo-cli , the most important and provides the core Hexo commands.

npm install hexo-cli -g
2. Install hexo-server , the build-in server.
npm install hexo-server -g 

install package throw error: sh: 1: node: Permission denied

Fix:

npm config set unsafe-perm true

Explain:

unsafe-perm: false(default) if running as root, true otherwise. Set to true to suppress the UID/GID switching when running

3. Initialize hexo home directory and install blog project.

mkdir blog_home

hexo init blog_home/

cd blog_home

npm install 

```

转载于:https://my.oschina.net/u/2500836/blog/869593

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值