docs: update nodejs installation instruction

* in readme, add instruction to install more updated nodejs
	* in readme, add a link to the relevant post for more detailed instruction
	* in posts, append 'or newer' to fedora, now that fedora v30 is released
	* in posts, add '--only=prod' parameter to skip devDeps
This commit is contained in:
curben 2019-05-18 14:49:46 +09:30
parent e5440eff3d
commit 5323544fd8
3 changed files with 19 additions and 13 deletions

View File

@ -9,19 +9,26 @@ Forked from GitLab's [Hexo](https://gitlab.com/pages/hexo) example with [Typing]
## Installation
> Refer to [this post](https://curben.netlify.com/2018/09/21/how-to-create-a-hexo-blog/) for more detailed instruction.
1. Change `<folder>` to a preferred name.
```bash
git clone https://gitlab.com/curben/blog <folder>
```
2. Install Node.js.
```bash
# Installing npm will also install nodejs as dependency.
# Ubuntu/Debian
sudo apt-get install npm
# Fedora/Red Hat
sudo yum install npm
# Ubuntu 16.04 or newer
$ sudo snap install node --classic --channel=10
# Debian
$ curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -
$ sudo apt-get install -y nodejs
# Fedora 29
$ sudo dnf install npm
# Fedora 28 or older
$ curl --silent --location https://rpm.nodesource.com/setup_10.x | sudo bash -
$ sudo yum -y install nodejs
# Arch Linux
sudo pacman -S npm
$ sudo pacman -S npm
```
3. Install Hexo and its dependencies (defined in [package.json](package.json)). `hexo-cli` installation step can be skipped if you use [this shortcut](https://curben.netlify.com/2018/10/24/running-locally-installed-node-packages/#Method-1).
```bash

View File

@ -61,7 +61,7 @@ deploy:
## Installation
1. Having Hexo means you can debug locally, rather than waiting for [Travis](https://travis-ci.com/). You can even run a local server to preview your blog (see step 6 below).
2. Clone your repo to your workstation.
3. Install Node.js 10. Other distro, see this [guide](https://nodejs.org/en/download/package-manager/) or [here](https://github.com/nodesource/distributions).
3. Install Node.js 10 (current [active LTS](https://github.com/nodejs/Release)). Other distro, see this [guide](https://nodejs.org/en/download/package-manager/) or [here](https://github.com/nodesource/distributions).
```bash
# Installing npm will also install nodejs as dependency.
@ -70,7 +70,7 @@ $ sudo snap install node --classic --channel=10
# Debian
$ curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -
$ sudo apt-get install -y nodejs
# Fedora 29
# Fedora 29 or newer
$ sudo dnf install npm
# Fedora 28 or older
$ curl --silent --location https://rpm.nodesource.com/setup_10.x | sudo bash -
@ -83,7 +83,7 @@ $ sudo pacman -S npm
```bash
$ cd <project>
$ npm install
$ npm install --only=prod
$ echo 'PATH="$PATH:./node_modules/.bin"' >> ~/.profile
```

View File

@ -36,16 +36,15 @@ Create a website/blog using Hexo on [GitLab Pages](https://about.gitlab.com/feat
## Installation
1. Having Hexo means you can debug locally, rather than waiting for [CI](https://docs.gitlab.com/ee/ci/). You can even run a local server to preview your blog (see step 6 below).
2. Clone your repo to your workstation.
3. Install Node.js 10. Other distro, see this [guide](https://nodejs.org/en/download/package-manager/) or [here](https://github.com/nodesource/distributions).
3. Install Node.js 10 (current [active LTS](https://github.com/nodejs/Release)). Other distro, see this [guide](https://nodejs.org/en/download/package-manager/) or [here](https://github.com/nodesource/distributions).
```bash
# Installing npm will also install nodejs as dependency.
# Ubuntu 16.04 or newer
$ sudo snap install node --classic --channel=10
# Debian
$ curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -
$ sudo apt-get install -y nodejs
# Fedora 29
# Fedora 29 or newer
$ sudo dnf install npm
# Fedora 28 or older
$ curl --silent --location https://rpm.nodesource.com/setup_10.x | sudo bash -
@ -58,7 +57,7 @@ $ sudo pacman -S npm
```bash
$ cd <folder>
$ npm install
$ npm install --only=prod
$ echo 'PATH="$PATH:./node_modules/.bin"' >> ~/.profile
```