<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="zh_CN">
  <title>wangjacks</title>
  <subtitle>A failure.</subtitle>
  <link href="https://blog.wj0.top/" rel="alternate" type="text/html"/>
  <link href="https://blog.wj0.top/atom.xml" rel="self" type="application/atom+xml"/>
  <id>https://blog.wj0.top/</id>
  <updated>2026-08-03T08:00:00.000Z</updated>
  <entry>
    <title>Node.js基础安装</title>
    <link href="https://blog.wj0.top/posts/setup-nodejs/" rel="alternate" type="text/html"/>
    <id>https://blog.wj0.top/posts/setup-nodejs/</id>
    <published>2026-08-03T08:00:00.000Z</published>
    <updated>2026-08-03T08:00:00.000Z</updated>
    <summary></summary>
    <content type="html"><![CDATA[<p>本文将介绍安装Node.js的基本流程。</p>
<p>&lt;!-- more --&gt;</p>
<p>写这篇文章主要因为类似的操作过于重复，直接将其记下来，方便后续直接使用。用途和<a href="/2026/06/12/nodejs-registry-mirrors/">更换镜像源</a>是一致的，只不过流程更加完整。</p>
<h2>1. 安装</h2>
<p>访问<a href="https://nodejs.org/zh-cn/download">Node.js官网</a>。Windows系统可直接下载<code>.msi</code>安装包进行安装；Linux系统可按<code>Linux -&gt; nvm -&gt; npm</code>在下拉菜单中选择，获取安装脚本。</p>
<p>截至目前，执行的内容应当是这样，核对没有问题可直接从官网复制并运行。（来自<a href="https://nodejs.org/zh-cn/download">Node.js官网</a>，这里默认选择<code>v24</code>版本）</p>
<pre><code># 下载并安装 nvm：
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash

# 代替重启 shell
\. "$HOME/.nvm/nvm.sh"

# 下载并安装 Node.js：
nvm install 24

# 验证 Node.js 版本：
node -v

# 验证 npm 版本：
npm -v
</code></pre>
<h2>2. 更换镜像源</h2>
<p>更详细的内容可参见<a href="/2026/06/12/nodejs-registry-mirrors/">更换镜像源</a>，这里出于简洁，默认采用<code>https://registry.npmmirror.com</code>。</p>
<pre><code># 1. 设置镜像源
npm config set registry https://registry.npmmirror.com

# 2. 验证是否修改成功
npm config get registry
# 应当返回: https://registry.npmmirror.com
</code></pre>
<h2>快速使用</h2>
<pre><code>curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash
\. "$HOME/.nvm/nvm.sh"
nvm install 24
node -v
npm -v

npm config set registry https://registry.npmmirror.com
npm config get registry
</code></pre>
]]></content>
    <author><name>Wang Jack</name></author>
    <category term="笔记"/>
  </entry>
  <entry>
    <title>Node.js更换镜像源</title>
    <link href="https://blog.wj0.top/posts/nodejs-registry-mirrors/" rel="alternate" type="text/html"/>
    <id>https://blog.wj0.top/posts/nodejs-registry-mirrors/</id>
    <published>2026-06-12T06:26:46.000Z</published>
    <updated>2026-06-12T06:26:46.000Z</updated>
    <summary></summary>
    <content type="html"><![CDATA[<p>本文将介绍在使用Node.js网络访问不佳时，如何为其更换镜像源。</p>
<p>&lt;!-- more --&gt;</p>
<p>和Python的PyPI使用国内镜像源的原因类似，当使用Node.js联网下包时，如果官方源连接不畅，体验会直线下降。除去更换网络外，可以更换镜像源。</p>
<p>目前常用的镜像源有这些：</p>
<table>
<thead>
<tr>
<th>源名称</th>
<th>源地址</th>
</tr>
</thead>
<tbody>
<tr>
<td>官方源（默认）</td>
<td>https://registry.npmjs.org</td>
</tr>
<tr>
<td>阿里云源</td>
<td>https://registry.npmmirror.com</td>
</tr>
<tr>
<td>腾讯云源</td>
<td>https://mirrors.cloud.tencent.com/npm</td>
</tr>
<tr>
<td>华为云源</td>
<td>https://repo.huaweicloud.com/repository/npm</td>
</tr>
<tr>
<td>中科大源</td>
<td>https://mirrors.ustc.edu.cn/npm</td>
</tr>
</tbody>
</table>
<h2>临时变更</h2>
<p>单次下包，可加<code>--registry</code>参数。</p>
<h3>模板</h3>
<pre><code># &lt;package-name&gt;: 包名; &lt;mirror-url&gt;: 源地址
npm install &lt;package-name&gt; --registry=&lt;mirror-url&gt;
</code></pre>
<h3>示例</h3>
<pre><code>npm install express --registry=https://registry.npmmirror.com
</code></pre>
<h2>全局变更</h2>
<h3>模板</h3>
<pre><code># 以npm为例，yarn/pnpm类似
# 1. 设置镜像源 &lt;mirror-url&gt;: 源地址
npm config set registry &lt;mirror-url&gt;

# 2. 验证是否修改成功
npm config get registry
</code></pre>
<h3>示例</h3>
<pre><code># 1. 设置镜像源
npm config set registry https://registry.npmmirror.com

# 2. 验证是否修改成功
npm config get registry
# 应当返回: https://registry.npmmirror.com
</code></pre>
]]></content>
    <author><name>Wang Jack</name></author>
  </entry>
  <entry>
    <title>2024年本博客后续发展打算</title>
    <link href="https://blog.wj0.top/posts/2024-blog-future-plan/" rel="alternate" type="text/html"/>
    <id>https://blog.wj0.top/posts/2024-blog-future-plan/</id>
    <published>2024-06-06T15:10:00.000Z</published>
    <updated>2024-06-06T15:10:00.000Z</updated>
    <summary></summary>
    <content type="html"><![CDATA[<h2>分开做的博客</h2>
<p>我在建博客时，刻意地将其分成了两部分去做：</p>
<ul>
<li><a href="https://www.blog233.com">Blog233</a>｜原定发布较为正式的内容，截止现在主要做教程和推荐。目前有10篇左右文章，很多内容需要重新整改。</li>
<li><a href="https://blog.wj0.top">WJBlog</a>｜也就是本博客，更偏向个人化，原定发布比较琐碎的内容。<s>因为符合我自己的要求的内容一篇都没有，文章还是从Blog233搬来的，所以我索性不保留任何内容了。</s></li>
</ul>
<p>从2020年前后开始做网站，一直有做正式的知识分享站的希望，希望将它做大，于是就有了这个Blog233。</p>
<h2>忙，忙，忙</h2>
<p>我不再是那个有充足时间的初中生了。时间真快，现在的我即将面临高考备战的洗礼，估计会有很多的事要做，这一年博客是彻底没法恢复正常更新了。但我会保持对博客的定期维护。</p>
<p>就像我在<a href="https://www.blog233.com/anniversary/2/">那个纪念页</a>里所说的那样：</p>
<blockquote>
<p>如果你看到这里，有充足的时间，有你想干的事，那请一定奋起实现，不要像我一样随着学业难度的上升愈加后悔！</p>
</blockquote>
<h2>博客转型的计划</h2>
<p>原先都采用<code>云服务器+WordPress</code>的模式。近期我已经将我的个人博客<code>blog.wj0.top</code>迁移到Hexo+Vercel的形式。具体而言是：</p>
<ol>
<li>云服务器ECS：进行一些Git操作（最近学Hexo，输Git命令比较频繁，基本熟悉了），在本地查看效果。</li>
<li>GitHub：私有库（除了评论），存放Hexo源文件，与服务器同步。</li>
<li>Vercel：对外展示博客。</li>
</ol>
<p>于是我寻思着Blog233要不要也做类似的处理，比如Hexo或者Hugo这些。对于我来说，WordPress的配置相对而言是更容易上手的，装个Yoast以及sitemap这样的插件就能做SEO优化，但是性能比较受限。</p>
<h2>确定的计划</h2>
<p>至于是保持原状再做性能优化，还是切换到其他的框架，后续再决定。但无论最终选择哪种平台，博客的核心价值毕竟是在于内容本身。我这一年确定的目标就是整理并修改我先前发布的文章，以我现在的经验重新审视文章，删去冗杂内容，尽量做到言简意赅。让现存的内容打磨得更有可能让人看、更能发挥价值，似乎也足够了。</p>
]]></content>
    <author><name>Wang Jack</name></author>
    <category term="闲谈"/>
  </entry>
  <entry>
    <title>Hello World</title>
    <link href="https://blog.wj0.top/posts/hello-world/" rel="alternate" type="text/html"/>
    <id>https://blog.wj0.top/posts/hello-world/</id>
    <published>2024-05-31T14:00:00.000Z</published>
    <updated>2024-05-31T14:00:00.000Z</updated>
    <summary></summary>
    <content type="html"><![CDATA[<p>Welcome to <a href="https://hexo.io/">Hexo</a>! This is your very first post. Check <a href="https://hexo.io/docs/">documentation</a> for more info. If you get any problems when using Hexo, you can find the answer in <a href="https://hexo.io/docs/troubleshooting.html">troubleshooting</a> or you can ask me on <a href="https://github.com/hexojs/hexo/issues">GitHub</a>.</p>
<h2>Quick Start</h2>
<h3>Create a new post</h3>
<pre><code>$ hexo new "My New Post"
</code></pre>
<p>More info: <a href="https://hexo.io/docs/writing.html">Writing</a></p>
<h3>Run server</h3>
<pre><code>$ hexo server
</code></pre>
<p>More info: <a href="https://hexo.io/docs/server.html">Server</a></p>
<h3>Generate static files</h3>
<pre><code>$ hexo generate
</code></pre>
<p>More info: <a href="https://hexo.io/docs/generating.html">Generating</a></p>
<h3>Deploy to remote sites</h3>
<pre><code>$ hexo deploy
</code></pre>
<p>More info: <a href="https://hexo.io/docs/one-command-deployment.html">Deployment</a></p>
]]></content>
    <author><name>Wang Jack</name></author>
  </entry>
</feed>
