分享知识,分享快乐

0%

hexo 常用命令

hexo 常用命令 :

1
2
3
4
5
6
7
8
$ hexo generate (hexo g) 生成静态文件
$ hexo server (hexo s) 启动本地服务
$ hexo deploy (hexo d) 提交到远程仓库
$ hexo new page "xx"(hexo n page) 创建页面
$ hexo new "xx" (hexo n "") 创建文章
$ hexo d -g 生成静态并提交到远程仓库
$ hexo s -g 生成静态文件并启动本地预览
$ hexo clean (hexo cl)清除本地 public 文件

其他参考:

5分钟搞定个人博客-hexo https://www.jianshu.com/p/390f202c5b0e

换终端更新hexo博客 https://www.jianshu.com/p/6a29f5243ab4

win10子系统安装

1
2
3
4
sudo apt update
sudo apt upgrade
sudo apt-get install npm
npm install -g hexo-cli@3.1.0

ubuntu18.04安装nodejs最新版、指定版 12.x 14.x

今天准备在 ubuntu 服务器里面安装 nodejs 版本,ubuntu 18.04 仓库 nodejs 默认是 8.x 版本。

1. 通过 apt 安装 nodejs

在 Ubuntu 18.04 的默认仓库包含了一个 Node.js 的版本,截至当前,该仓库的 node.js 版本是 8.10.0 。要安装此版本,你可以使用 apt 包管理器。先刷新你的本地包索引,通过如下命令:

1
sudo apt update

然后运行安装命令:

1
sudo apt install nodejs

2. 通过 PPA 安装指定或最新版本的 nodejs

那么就需要使用 nodesource 来安装指定版本的 nodejs 了。其需要下载一个脚本,运行此脚本会在 ubuntu 里添加一个 nodejs 源,然后用 apt 就可以下载指定的 nodejs 了。

PPA 的全称为 personal package archive 。要安装 nodejs 12.x 版本,可以运行如下命令:

1
2
3
4
cd ~
curl -sL https://deb.nodesource.com/setup_12.x | sudo bash -
sudo apt update
sudo apt install nodejs

要安装 nodejs 最新版本,可以运行如下命令:

1
2
3
4
cd ~
curl -sL https://deb.nodesource.com/setup | sudo bash -
sudo apt update
sudo apt install nodejs

3. 如何卸载 nodejs

执行如下命令:

1
sudo apt remove nodejs

此命令会卸载 nodejs,但是会保留配置文件,方便你以后再次安装 nodejs。

如果不想保留配置文件,继续执行:

1
sudo apt purge nodejs

这将会卸载 nodejs 和其相关的配置文件。

最后,你还可以移除和 nodejs 一起安装但是现在没有被使用的包:

1
sudo apt autoremove