0%

变量名说明备注
$host请求中的主机头(Host)字段如果请求中的主机头不可用或为空,则为处理请求的server名称(处理请求的server的server_name指令的值)。值为小写,不包含端口。
$server_name服务器名称nginx conf文件Server模块中定义的值
$server_port服务器端的端口号eg: 80、8080、443
$remote_port客户端的端口
$remote_addr客户端的IP地址
$$binary_remote_addr二进制码形式的客户端地址
$document_root当前请求在root指令中指定的值
$scheme协议eg: http、https
$cookie_COOKIEcookie中COOKIE的值eg: $cookie_iploc
$http_HEADER匹配任意请求头字段“HEADER”可以替换成任意请求头字段,如在配置文件中需要获取http请求头:“Accept-Language”,那么将“-”替换为下划线,大写字母替换为小写,形如:$http_accept_language即可。
$sent_http_HEADERHTTP响应头中的内容,HEADER为HTTP响应中的内容转为小写,-变为_(破折号变为下划线)eg: $sent_http_cache_control、$sent_http_content_type
$request_uri请求参数的原始URI无法修改,请查看$uri更改或重写URI
$uri请求中的当前URI(不带请求参数,参数位于$args)不同于浏览器传递的$request_uri的值,它可以通过内部重定向,或者使用index指令进行修改。不包括协议和主机名,例如/foo/bar.html
$document_uri与$uri相同
$argsGET请求中的参数eg: foo=123&bar=abc;
$arg_name请求中参数name的值
$query_string与$args相同
$arg_PARAMETERGET请求中变量名PARAMETER参数的值
$http_referer引导用户代理到当前页的前一页的地址信息
$http_x_forwarded-for表示 HTTP 请求端真实 IPX-Forwarded-For格式:X-Forwarded-For: client, proxy1, proxy2XFF的内容由「英文逗号+空格」隔开的多个部分组成,第一个IP是离服务端最远的设备IP,然后是每一级代理的IP
  • 通常情况下:$request_uri=$document_uri($uri)+$query_string($args)
  • eg: http://localhost:8080/test1/test2/index.php?a=1&b=2&c=3
    1
    2
    3
    4
    5
    6
    7
    8
    >$server_port:8080
    >$request_uri:/test1/test2/index.php?a=1&b=2&c=3
    >$document_uri:/test1/test2/index.php
    >$query_string: a=1&b=2&c=3
    >$uri: /test1/test2/index.php
    >$args: a=1&b=2&c=3
    >$document_root:/usr/local/nginx/html
    >$request_filename:/usr/local/nginx/html/test1/test2/index.php

  • 查看历史命令(快捷键:F7)

    1
    doskey /history
  • 查看端口

    1
    netstat -ano|findstr "80"
  • 查看进程PID

    1
    2
    3
    4
    tasklist
    # /s computer 制定远程计算机名称或IP
    # /u domain\user 指定用户
    # /p password 指定用户密码
  • 查看进程PID

    1
    2
    3
    4
    5
    6
    7
    taskkill
    # /s computer 制定远程计算机名称或IP
    # /u domain\user 指定用户
    # /p password 指定用户密码
    # /pid ProcessID 被终止进程的ID
    # /f 强制终止。远程进程可忽略此参数,所有远程进程都会被强制终止
    # /t 终止与父进程的所有子进程
  • 自动关机

    1
    2
    3
    4
    5
    6
    7
    shutdown
    # /m \\ComputerName 关闭远程机器
    # /l 注销当前用户
    # /s 关机
    # /r 重启
    # /f 强制关闭应用程序
    # /c "comment" 操作说明
  • 文件系统转换

    1
    2
    convert D: /fs:ntfs /x
    # /x 强制卸除卷标
  • 磁盘检查

    1
    2
    3
    4
    chkdsk C: /X /R /F
    # /X 如果必要,则先强制卸除卷。
    # /R 查找坏扇区并恢复可读信息
    # /F 修复磁盘上的错误。
  • 修改文件属性

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    attrib [+R|-R] [+A|-A] [+S|-S] [+H|-H] [+I|-I] [drive:][path][filename] [/S [/D] [/L]]
    # + 设置属性。
    # - 清除属性。
    # R 只读文件属性。
    # A 存档文件属性。
    # S 系统文件属性。
    # H 隐藏文件属性。
    # I 无内容索引文件属性。
    # X 无清理文件属性。
    # V 完整性属性。
    # [drive:][path][filename]指定 attrib 要处理的文件
    # /S 处理当前文件夹及其所有子文件夹中的匹配文件
    # /D 也处理文件夹。
    # /L 处理符号链接和符号链接目标的属性
  • 内网主机名IP互查

    1
    2
    3
    4
    5
    6
    根据IP查主机名
    nbtstat -A IP
    ping -a IP
    根据主机名查IP
    nbtstat -a 主机名
    ping 主机名
  • 组策略

    1
    2
    3
    4
    5
    6
    打开组策略
    gpedit.msc
    强制刷新组策略
    gpupdate /force
    仅刷新用户策略
    gpupdate /target:user
    • 一般如果所有配置都正确的情况下,Mac远程桌面Windows依然连不上,就强制刷新一下组策略有可能会出现奇迹。。。
  • help

    1
    2
    help [command]
    # 提供 Windows 命令的帮助信息。

node环境

初始化

1
2
3
4
npm install hexo-cli -g
hexo init MyBlog
cd MyBlog
npm install

安装主题

1
git clone https://github.com/iissnan/hexo-theme-next.git themes/next

创建页面

1
2
3
hexo new page "tags"
hexo new page categories
hexo new page "about"

安装插件

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
npm install --save hexo-server
npm install --save hexo-wordcount
npm install --save hexo-asset-image
npm install --save hexo-generator-tag
npm install --save hexo-generator-feed
npm install --save hexo-generator-index
npm install --save hexo-generator-archive
npm install --save hexo-generator-category
npm install --save hexo-generator-search
npm install --save hexo-generator-searchdb
npm install --save hexo-generator-sitemap
npm install --save hexo-generator-baidu-sitemap
npm install --save hexo-generator-seo-friendly-sitemap
# npm install --save hexo-filter-indicate-the-source
# 压缩
npm install --save hexo-uglify
npm install --save hexo-imagemin # 安装报错 19
npm install --save hexo-clean-css
npm install --save hexo-html-minifier # 安装报错 2
npm install --save gulp-minify-css gulp-uglify gulp-htmlmin gulp-htmlclean gulp

# 发布
npm install --save hexo-deployer-git
npm install --save hexo-deployer-rsync

# 其它插件
npm install --save hexo-recommended-posts

常用命令

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# 清空缓存
hexo clean

# 创建草稿
hexo new draft "My first Blog"

# 将草稿发布成文章
hexo publish "My first Blog"

# 直接创建文章
hexo new "My second Blog"

# 生成静态文件并部署网站
hexo generate(g) --deploy( -d)

# 启动本地服务
hexo server -i 10.0.0.1 -p 80 -l

# 获取推荐文章列表,前提是已安装hexo-recommended-posts插件
hexo recommend

优化

首页博客间距调整

1
2
hexo-theme-next\source\css\_schemes\Mist\_posts-expanded.styl
.post { margin-top: 60px; }

自定义内容区域的宽度

1
2
3
4
5
hexo-theme-next\source\css\_variables\custom.styl
$content-desktop = 700px
$content-desktop-large = 900px
# 此方法不适用于 Pisces Scheme
# 移动设备下,宽度自适应

替换文章标签图标

  • themes/hexo-theme-next-6.7.0/layout/_macro/post.swig
1
2
3
4

rel="tag">#
替换为
rel="tag"><i class="fa fa-tag"></i>

自定义样式优化

  • themes\hexo-theme-next-6.7.0\source\css_custom\custom.styl 追加
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
// 主页文章添加阴影效果
.post {
margin-top: 2%;
margin-bottom: 5%;
padding: 1%;
-webkit-box-shadow: 0 0 5px rgba(202, 203, 203, .5);
-moz-box-shadow: 0 0 5px rgba(202, 203, 204, .5);
}

.main-inner {
margin-top: 2%;
padding: 2% 2% 2% 2%;
background: #fff;
min-height: 95%;
}

.footer {
margin-top: 1%;
}

// 自动更新背景图片
body {
background: url(https://source.unsplash.com/random/1600x900);
background-repeat: no-repeat;
background-attachment:fixed;
background-size: cover;
background-position:50% 50%;
}

// 修改博客页面宽度
.container .main-inner {
width: 85%;
}

// 优化修改博客标题位置
.posts-expand .post {
margin-top: 3%;
}

// 优化标题字体大写
.menu .menu-item a, .menu .menu-item span.exturl {
font-size: 16px;
}

公益404页面优化404效果

  • 在source目录下创建404.html
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    <!DOCTYPE HTML>
    <html>
    <head>
    <meta http-equiv="content-type" content="text/html;charset=utf-8;"/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
    <meta name="robots" content="all" />
    <meta name="robots" content="index,follow"/>
    <link rel="stylesheet" type="text/css" href="https://qzone.qq.com/gy/404/style/404style.css">
    </head>
    <body>
    <script type="text/javascript" src="//qzonestyle.gtimg.cn/qzone/hybrid/app/404/search_children.js" charset="utf-8" homePageUrl="https://www.lengyuewusheng.com" homePageName="回到 www.lengyuewusheng.com"></script>
    </body>
    </html>
    • 测试只有在发布到github pages上才生效,本地测试无法直接跳转。

文章结尾增加版权声明

  • themes/hexo-theme-next-6.7.0/layout/_macro/ 目录下创建 my-copyright.swig
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
{% if page.copyright %}
<div class="my_post_copyright">
<script src="//cdn.bootcss.com/clipboard.js/1.5.10/clipboard.min.js"></script>

<!-- JS库 sweetalert 可修改路径 -->
<script type="text/javascript" src="http://jslibs.wuxubj.cn/sweetalert_mini/jquery-1.7.1.min.js"></script>
<script src="http://jslibs.wuxubj.cn/sweetalert_mini/sweetalert.min.js"></script>
<link rel="stylesheet" type="text/css" href="http://jslibs.wuxubj.cn/sweetalert_mini/sweetalert.mini.css">
<p><span>本文标题:</span><a href="{{ url_for(page.path) }}">{{ page.title }}</a></p>
<p><span>文章作者:</span><a href="/" title="访问 {{ theme.author }} 的个人博客">{{ theme.author }}</a></p>
<p><span>发布时间:</span>{{ page.date.format("YYYY年MM月DD日 - HH:MM") }}</p>
<p><span>最后更新:</span>{{ page.updated.format("YYYY年MM月DD日 - HH:MM") }}</p>
<p><span>原始链接:</span><a href="{{ url_for(page.path) }}" title="{{ page.title }}">{{ page.permalink }}</a>
<span class="copy-path" title="点击复制文章链接"><i class="fa fa-clipboard" data-clipboard-text="{{ page.permalink }}" aria-label="复制成功!"></i></span>
</p>
<!-- p><span>许可协议:</span><i class="fa fa-creative-commons"></i> <a rel="license" href="https://creativecommons.org/licenses/by-nc-nd/4.0/" target="_blank" title="Attribution-NonCommercial-NoDerivatives 4.0 International (CC BY-NC-ND 4.0)">署名-非商业性使用-禁止演绎 4.0 国际</a> 转载请保留原文链接及作者。</p -->
<p><span>许可协议:</span>本博客所有文章除特别声明外,均采用<i class="fa fa-creative-commons"></i><a href="https://creativecommons.org/licenses/by-nc-sa/3.0/" rel="external nofollow" target="_blank"> BY-NC-SA 3.0</a>许可协议。转载请注明出处!</p>
</div>
<script>
var clipboard = new Clipboard('.fa-clipboard');
clipboard.on('success', $(function(){
$(".fa-clipboard").click(function(){
swal({
title: "",
text: '复制成功',
html: false,
timer: 500,
showConfirmButton: false
});
});
}));
</script>
{% endif %}
  • themes/hexo-theme-next-6.7.0/source/css/_common/components/post/ 目录下创建 my-post-copyright.styl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
.my_post_copyright {
width: 85%;
max-width: 45em;
margin: 2.8em auto 0;
padding: 0.5em 1.0em;
border: 1px solid #d3d3d3;
font-size: 0.93rem;
line-height: 1.6em;
word-break: break-all;
background: rgba(255,255,255,0.4);
}
.my_post_copyright p{margin:0;}
.my_post_copyright span {
display: inline-block;
width: 5.2em;
color: #b5b5b5;
font-weight: bold;
}
.my_post_copyright .raw {
margin-left: 1em;
width: 5em;
}
.my_post_copyright a {
color: #808080;
border-bottom:0;
}
.my_post_copyright a:hover {
color: #a3d2a3;
text-decoration: underline;
}
.my_post_copyright:hover .fa-clipboard {
color: #000;
}
.my_post_copyright .post-url:hover {
font-weight: normal;
}
.my_post_copyright .copy-path {
margin-left: 1em;
width: 1em;
+mobile(){display:none;}
}
.my_post_copyright .copy-path:hover {
color: #808080;
cursor: pointer;
}
  • 修改 themes/hexo-theme-next-6.7.0/layout/_macro/post.swig
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
 {% if theme.wechat_subscriber.enabled and not is_index %}
<div>
{% include '../_partials/post/wechat-subscriber.swig' %}
</div>
{% endif %}
#========在include ../_partials/post/wechat-subscriber.swig逻辑下追加以下内容=============
<div>
{% if not is_index %}
{% include 'passage-end-tag.swig' %}
{% endif %}
</div>
<div>
{% if not is_index %}
{% include 'my-copyright.swig' %}
{% endif %}
</div>
  • themes/hexo-theme-next-6.7.0/source/css/_common/components/post/post.styl追加一行
1
@import "my-post-copyright"
  • themes/hexo-theme-next-6.7.0/layout/_macro/ 目录下新建 passage-end-tag.swig
1
2
3
4
5
<div>
{% if not is_index %}
<div style="text-align:center;color: #ccc;font-size:14px;">-------------End of article. <i class="fa fa-paw"></i> I appreciate whoever read and leave commends on articles.-------------</div>
{% endif %}
</div>
  • themes/hexo-theme-next-6.7.0/_config.yml中追加
1
2
passage_end_tag:
enabled: true
  • 博客文章头中声明copyright
1
2
3
---
copyright: true
---
  • 定制草稿模板

    修改lengyuewusheng.com/scaffolds/draft.md

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    ---
    title: {{ title }}
    date: {{ date }}
    tags:
    -
    -
    -
    categories:
    -
    copyright: true
    keywords: Blog,lengyuewusheng
    description: Describe briefly.
    ---

    {% cq %}
    摘要内容
    {% endcq %}

    <!--more-->

    正文

常见问题

生成发布时报错,几乎没有有效信息。。。

  • 报错内容:
1
2
3
H:\hexo-Blog>hexo g -d
INFO Start processing
FATAL Something's wrong. Maybe you can find the solution here: http://hexo.io/docs/troubleshooting.html
  • 处理方案:

此种情况大概率是由于你的博客的Markdown文件中存在非表格格式的竖线或其它Markdown难以解析的符号导致,如果存在竖线,将竖线用&#124替换,如果存在其它特殊符号将符号删除即可。

hexo generate 执行报错

  • 报错内容:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
H:\hexo-Blog>hexo g
INFO Start processing
INFO Files loaded in 1.97 s
INFO Generated: baidusitemap.xml
ERROR Asset render failed: lib/canvas-ribbon/canvas-ribbon.js
SyntaxError: Unexpected token: operator (>)
at JS_Parse_Error.get (eval at <anonymous> (H:\hexo-Blog\node_modules\hexo-uglify\node_modules\uglify-js\tools\node.js:27:1), <anonymous>:86:23)
at getFullErrorStack (H:\hexo-Blog\node_modules\hexo-bunyan\lib\bunyan.js:1129:18)
at Object.Logger.stdSerializers.err (H:\hexo-Blog\node_modules\hexo-bunyan\lib\bunyan.js:1147:16)
at H:\hexo-Blog\node_modules\hexo-bunyan\lib\bunyan.js:873:50
at Array.forEach (<anonymous>)
at Logger._applySerializers (H:\hexo-Blog\node_modules\hexo-bunyan\lib\bunyan.js:865:35)
at mkRecord (H:\hexo-Blog\node_modules\hexo-bunyan\lib\bunyan.js:978:17)
at Logger.<anonymous> (H:\hexo-Blog\node_modules\hexo-bunyan\lib\bunyan.js:1044:19)
at self.render.render.catch.err (H:\hexo-Blog\node_modules\hexo\lib\plugins\generator\asset.js:33:20)
at tryCatcher (H:\hexo-Blog\node_modules\bluebird\js\release\util.js:16:23)
at Promise._settlePromiseFromHandler (H:\hexo-Blog\node_modules\bluebird\js\release\promise.js:512:31)
at Promise._settlePromise (H:\hexo-Blog\node_modules\bluebird\js\release\promise.js:569:18)
at Promise._settlePromise0 (H:\hexo-Blog\node_modules\bluebird\js\release\promise.js:614:10)
at Promise._settlePromises (H:\hexo-Blog\node_modules\bluebird\js\release\promise.js:689:18)
at Async._drainQueue (H:\hexo-Blog\node_modules\bluebird\js\release\async.js:133:16)
at Async._drainQueues (H:\hexo-Blog\node_modules\bluebird\js\release\async.js:143:10)
at Immediate.Async.drainQueues (H:\hexo-Blog\node_modules\bluebird\js\release\async.js:17:14)
at runCallback (timers.js:789:20)
at tryOnImmediate (timers.js:751:5)
at processImmediate [as _immediateCallback] (timers.js:722:5)
INFO Generated: atom.xml
INFO Generated: search.xml
  • 处理方案:
1
npm remove hexo-asset-image hexo-generator-seo-friendly-sitemap --save
  • 报错内容:

    1
    2
    found 5 vulnerabilities (2 low, 3 high)
    run `npm audit fix` to fix them, or `npm audit` for details
  • 处理方案:

    1
    hexo-asset-image hexo-generator-seo-friendly-sitemap
  • 报错内容:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
ERROR path.substring is not a function
TypeError: path.substring is not a function
at Object.urlForHelper (H:\hexo-Blog\node_modules\hexo\lib\plugins\helper\url_for.js:9:31)
at wrapper (H:\hexo-Blog\node_modules\lodash\lodash.js:4941:19)
at Object.eval [as tpl] (eval at precompile (H:\hexo-Blog\node_modules\swig-templates\lib\swig.js:497:13), <anonymous>:125:119)
at compiled (H:\hexo-Blog\node_modules\swig-templates\lib\swig.js:618:18)
at Object.eval [as tpl] (eval at precompile (H:\hexo-Blog\node_modules\swig-templates\lib\swig.js:497:13), <anonymous>:263:126)
at compiled (H:\hexo-Blog\node_modules\swig-templates\lib\swig.js:618:18)
at Theme._View.View._compiled (H:\hexo-Blog\node_modules\hexo\lib\theme\view.js:127:30)
at Theme._View.View.View.render (H:\hexo-Blog\node_modules\hexo\lib\theme\view.js:29:15)
at H:\hexo-Blog\node_modules\hexo\lib\hexo\index.js:390:29
at tryCatcher (H:\hexo-Blog\node_modules\bluebird\js\release\util.js:16:23)
at H:\hexo-Blog\node_modules\bluebird\js\release\method.js:15:34
at RouteStream._read (H:\hexo-Blog\node_modules\hexo\lib\hexo\router.js:134:3)
at RouteStream.Readable.read (_stream_readable.js:442:10)
at resume_ (_stream_readable.js:822:12)
at _combinedTickCallback (internal/process/next_tick.js:138:11)
at process._tickCallback (internal/process/next_tick.js:180:9)
ERROR path.substring is not a function
TypeError: path.substring is not a function
at Object.urlForHelper (H:\hexo-Blog\node_modules\hexo\lib\plugins\helper\url_for.js:9:31)
at wrapper (H:\hexo-Blog\node_modules\lodash\lodash.js:4941:19)
at Object.eval [as tpl] (eval at precompile (H:\hexo-Blog\node_modules\swig-templates\lib\swig.js:497:13), <anonymous>:125:119)
at compiled (H:\hexo-Blog\node_modules\swig-templates\lib\swig.js:618:18)
at Object.eval [as tpl] (eval at precompile (H:\hexo-Blog\node_modules\swig-templates\lib\swig.js:497:13), <anonymous>:263:126)
at compiled (H:\hexo-Blog\node_modules\swig-templates\lib\swig.js:618:18)
at Theme._View.View._compiled (H:\hexo-Blog\node_modules\hexo\lib\theme\view.js:127:30)
at Theme._View.View.View.render (H:\hexo-Blog\node_modules\hexo\lib\theme\view.js:29:15)
at H:\hexo-Blog\node_modules\hexo\lib\hexo\index.js:390:29
at tryCatcher (H:\hexo-Blog\node_modules\bluebird\js\release\util.js:16:23)
at H:\hexo-Blog\node_modules\bluebird\js\release\method.js:15:34
at RouteStream._read (H:\hexo-Blog\node_modules\hexo\lib\hexo\router.js:134:3)
at RouteStream.Readable.read (_stream_readable.js:442:10)
at resume_ (_stream_readable.js:822:12)
at _combinedTickCallback (internal/process/next_tick.js:138:11)
at process._tickCallback (internal/process/next_tick.js:180:9)
ERROR path.substring is not a function
TypeError: path.substring is not a function
at Object.urlForHelper (H:\hexo-Blog\node_modules\hexo\lib\plugins\helper\url_for.js:9:31)
at wrapper (H:\hexo-Blog\node_modules\lodash\lodash.js:4941:19)
at Object.eval [as tpl] (eval at precompile (H:\hexo-Blog\node_modules\swig-templates\lib\swig.js:497:13), <anonymous>:125:119)
at compiled (H:\hexo-Blog\node_modules\swig-templates\lib\swig.js:618:18)
at Object.eval [as tpl] (eval at precompile (H:\hexo-Blog\node_modules\swig-templates\lib\swig.js:497:13), <anonymous>:263:126)
at compiled (H:\hexo-Blog\node_modules\swig-templates\lib\swig.js:618:18)
at Theme._View.View._compiled (H:\hexo-Blog\node_modules\hexo\lib\theme\view.js:127:30)
at Theme._View.View.View.render (H:\hexo-Blog\node_modules\hexo\lib\theme\view.js:29:15)
at H:\hexo-Blog\node_modules\hexo\lib\hexo\index.js:390:29
at tryCatcher (H:\hexo-Blog\node_modules\bluebird\js\release\util.js:16:23)
at H:\hexo-Blog\node_modules\bluebird\js\release\method.js:15:34
at RouteStream._read (H:\hexo-Blog\node_modules\hexo\lib\hexo\router.js:134:3)
at RouteStream.Readable.read (_stream_readable.js:442:10)
at resume_ (_stream_readable.js:822:12)
at _combinedTickCallback (internal/process/next_tick.js:138:11)
at process._tickCallback (internal/process/next_tick.js:180:9)
......
  • 处理方案:
1
该问题是在升级Next v5.1.4时出现,首先将Next回滚,然后将本地的node_modules文件夹删除,同时删除package-lock.json,重新执行`npm install`生成node_modules目录后恢复。

hexo deploy 执行报错

  • 报错内容:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
fatal: HttpRequestException encountered.
��������ʱ�����
bash: /dev/tty: No such device or address
error: failed to execute prompt script (exit code 1)
fatal: could not read Username for 'https://github.com': No error
FATAL Something's wrong. Maybe you can find the solution here: http://hexo.io/docs/troubleshooting.html
Error: fatal: HttpRequestException encountered.
��������ʱ����
bash: /dev/tty: No such device or address
error: failed to execute prompt script (exit code 1)
fatal: could not read Username for 'https://github.com': No error

at ChildProcess.<anonymous> (H:\hexo-Blog\node_modules\hexo-util\lib\spawn.js:37:17)
at emitTwo (events.js:126:13)
at ChildProcess.emit (events.js:214:7)
at ChildProcess.cp.emit (H:\hexo-Blog\node_modules\cross-spawn\lib\enoent.js:40:29)
at maybeClose (internal/child_process.js:925:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)

H:\hexo-Blog>
  • 处理方案:
1
这种问题可能是因为本地git环境被破坏导致,重装或升级一下本地git即可解决问题。

相关资料

不得不说,想做成一件事情真的很难。

酝酿三年,筹备半年,将近一个月的紧密实施,博客终于赶在今天悄然上线了。

不得不说,做任何事情只要肯走心,一定能够做成,如果没成,那就再花点心思。

在这个自媒体泛滥的时代,碎片化的知识无处不在,

然而我并不励志做一个媒体人,我只是希望把日常的进步积累下来,

蹉跎岁月中最后能留下点自己亲手创造的价值。

还记得QQ空间刚火起来的那些年,每隔几个月都会挤时间跑到网吧里就为了写一篇博客,

后来变成了每到寒暑假写一篇总结,再到后来每到年末回首过去展望未来写一篇,

再后来我就变得不会写字了,如今算起来已经三四年没有认真写过东西了。

从今天起,做一个爱学习爱总结的人,借助博客督促自己多读书,多学习,多努力。

如果在自己进步的同时,无意中也帮到了你,这也算是一件让人开心的事儿了。

已经很晚了,再不睡觉天都要亮了,今天就写到这儿吧,来日方长,积水成渊吧!