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 ## 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. 1. Change `<folder>` to a preferred name.
```bash ```bash
git clone https://gitlab.com/curben/blog <folder> git clone https://gitlab.com/curben/blog <folder>
``` ```
2. Install Node.js. 2. Install Node.js.
```bash ```bash
# Installing npm will also install nodejs as dependency. # Ubuntu 16.04 or newer
# Ubuntu/Debian $ sudo snap install node --classic --channel=10
sudo apt-get install npm # Debian
# Fedora/Red Hat $ curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -
sudo yum install npm $ 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 # 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). 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 ```bash

View File

@ -61,7 +61,7 @@ deploy:
## Installation ## 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). 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. 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 ```bash
# Installing npm will also install nodejs as dependency. # Installing npm will also install nodejs as dependency.
@ -70,7 +70,7 @@ $ sudo snap install node --classic --channel=10
# Debian # Debian
$ curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash - $ curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -
$ sudo apt-get install -y nodejs $ sudo apt-get install -y nodejs
# Fedora 29 # Fedora 29 or newer
$ sudo dnf install npm $ sudo dnf install npm
# Fedora 28 or older # Fedora 28 or older
$ curl --silent --location https://rpm.nodesource.com/setup_10.x | sudo bash - $ curl --silent --location https://rpm.nodesource.com/setup_10.x | sudo bash -
@ -83,7 +83,7 @@ $ sudo pacman -S npm
```bash ```bash
$ cd <project> $ cd <project>
$ npm install $ npm install --only=prod
$ echo 'PATH="$PATH:./node_modules/.bin"' >> ~/.profile $ 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 ## 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). 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. 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 ```bash
# Installing npm will also install nodejs as dependency.
# Ubuntu 16.04 or newer # Ubuntu 16.04 or newer
$ sudo snap install node --classic --channel=10 $ sudo snap install node --classic --channel=10
# Debian # Debian
$ curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash - $ curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -
$ sudo apt-get install -y nodejs $ sudo apt-get install -y nodejs
# Fedora 29 # Fedora 29 or newer
$ sudo dnf install npm $ sudo dnf install npm
# Fedora 28 or older # Fedora 28 or older
$ curl --silent --location https://rpm.nodesource.com/setup_10.x | sudo bash - $ curl --silent --location https://rpm.nodesource.com/setup_10.x | sudo bash -
@ -58,7 +57,7 @@ $ sudo pacman -S npm
```bash ```bash
$ cd <folder> $ cd <folder>
$ npm install $ npm install --only=prod
$ echo 'PATH="$PATH:./node_modules/.bin"' >> ~/.profile $ echo 'PATH="$PATH:./node_modules/.bin"' >> ~/.profile
``` ```