<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>ubuntu - 十步回眸一笑 - 个人技术笔记</title>
	<atom:link href="https://www.hishd.top/archives/tag/ubuntu/feed" rel="self" type="application/rss+xml" />
	<link>https://www.hishd.top</link>
	<description></description>
	<lastBuildDate>Mon, 30 Jan 2023 22:59:25 +0000</lastBuildDate>
	<language>zh-Hans</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>
	<item>
		<title>Ubuntu安装 云崽v3.0（Yunzai-Bot v3）</title>
		<link>https://www.hishd.top/archives/192</link>
					<comments>https://www.hishd.top/archives/192#respond</comments>
		
		<dc:creator><![CDATA[DB.Russell]]></dc:creator>
		<pubDate>Mon, 30 Jan 2023 22:57:00 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[ubuntu]]></category>
		<guid isPermaLink="false">https://www.hishd.top/?p=192</guid>

					<description><![CDATA[云崽是一个原神qq群机器人，通过米游社接口，查询原神游戏信息并快速生成图片。 项目地址：GitHub / Gi [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p>云崽是一个原神qq群机器人，通过米游社接口，查询原神游戏信息并快速生成图片。</p>



<p>项目地址：<a rel="noreferrer noopener" href="https://github.com/Le-niao/Yunzai-Bot" data-type="URL" data-id="https://github.com/Le-niao/Yunzai-Bot" target="_blank">GitHub</a> / <a rel="noreferrer noopener" href="https://gitee.com/Le-niao/Yunzai-Bot" data-type="URL" data-id="https://gitee.com/Le-niao/Yunzai-Bot" target="_blank">Gitee</a></p>



<p>前言：这个项目目前可以使用手机、windows以及linux搭建，这些搭建的服务器使用的是Ubuntu系统。Centos系统环境可以通过其他命令安装。</p>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow">
<p>环境准备： Windows or Linux，Node.js（<a href="http://nodejs.cn/download/" target="_blank" rel="noreferrer noopener">版本至少v16以上</a>），<a href="https://redis.io/docs/getting-started/installation/" target="_blank" rel="noreferrer noopener">Redis</a></p>
<cite>（以上引用自项目）</cite></blockquote>



<p>运行环境准备：</p>



<p>Node.js环境安装可以参考这里 <a href="https://www.hishd.top/archives/2023/196" data-type="URL" data-id="https://www.hishd.top/archives/2023/196" target="_blank" rel="noreferrer noopener">Ubuntu安装Node</a></p>



<p>安装Redis：</p>



<p>将存储库添加到apt索引，更新，然后安装：</p>



<pre class="wp-block-code"><code>curl -fsSL https://packages.redis.io/gpg | sudo gpg --dearmor -o /usr/share/keyrings/redis-archive-keyring.gpg
echo "deb &#91;signed-by=/usr/share/keyrings/redis-archive-keyring.gpg] https://packages.redis.io/deb $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/redis.list
sudo apt-get update
sudo apt-get install redis</code></pre>



<p>接下里克隆项目：</p>



<p>国外机子使用GitHub</p>



<pre class="wp-block-code"><code>git clone --depth=1 -b main https://github.com/Le-niao/Yunzai-Bot.git
cd Yunzai-Bot #进入Yunzai目录</code></pre>



<p>国内机子使用Gitee</p>



<pre class="wp-block-code"><code>git clone --depth=1 -b main https://gitee.com/Le-niao/Yunzai-Bot.git
cd Yunzai-Bot #进入Yunzai目录</code></pre>



<p>安装pnpm（已安装的可以跳过）</p>



<pre class="wp-block-code"><code>npm install pnpm -g
</code></pre>



<p>通过pnpm安装依赖</p>



<pre class="wp-block-code"><code>pnpm install -P
</code></pre>



<p>运行（首次运行按提示输入登录）</p>



<pre class="wp-block-code"><code>node app
</code></pre>



<p></p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.hishd.top/archives/192/feed</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Ubuntu安装Node.js</title>
		<link>https://www.hishd.top/archives/196</link>
					<comments>https://www.hishd.top/archives/196#respond</comments>
		
		<dc:creator><![CDATA[DB.Russell]]></dc:creator>
		<pubDate>Mon, 30 Jan 2023 21:52:35 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[ubuntu]]></category>
		<guid isPermaLink="false">https://www.hishd.top/?p=196</guid>

					<description><![CDATA[Node.js 是一个跨平台的 JavaScript 运行环境，它构建在为了在服务器端运行 JavaScrip [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p>Node.js 是一个跨平台的 JavaScript 运行环境，它构建在为了在服务器端运行 JavaScript 代码而设计的 Chrome JavaScript 上。它通常被用来构建后端应用，但是它也是非常流行的全栈和前端解决方案。npm 是 Node.js 的默认包管理工具，也是世界上最大的软件仓库。<br>这里将介绍，在 Ubuntu 上安装 Node.js 和 npm 三种不同的方式。</p>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<p>第一种：从 Ubuntu 软件源安装 Node.js 和 npm</p>



<pre class="wp-block-code"><code>sudo apt update
sudo apt install nodejs npm</code></pre>



<p>上面的命令将会安装一系列包，包括编译和安装从 npm 来的本地扩展。<br>安装完成后运行下面的命令，验证安装</p>



<pre class="wp-block-code"><code>nodejs --version</code></pre>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<p><strong>第二种：从 NodeSource 中安装 Node.js 和 npm</strong></p>



<p>NodeSource 是一个公司，聚焦于提供企业级的 Node 支持。它维护了一个 APT 软件源，其中包含了很多 Node.js 版本。如果你的应用需要指定版本的Node.js 版本，使用这个软件源。</p>



<p><strong>项目地址</strong>：<a href="https://github.com/nodesource/distributions" data-type="URL" data-id="https://github.com/nodesource/distributions" target="_blank" rel="noreferrer noopener">GitHub</a></p>



<p><strong>使用Ubuntu</strong></p>



<pre class="wp-block-code"><code>curl -fsSL https://deb.nodesource.com/setup_<strong><mark style="background-color:rgba(0, 0, 0, 0)" class="has-inline-color has-vivid-red-color">19</mark></strong>.x | sudo -E bash - &amp;&amp;\
sudo apt-get install -y nodejs</code></pre>



<p>如果需要安装其他版本的话，可以自行更换代码中红色的数字。如 setup_18.x  setup_16.x 等</p>



<p>nodejs 软件包同时包含node和npm二进制包。</p>



<p>可选：安装构建工具</p>



<p>要从 npm 编译和安装本机插件，您可能还需要安装构建工具：</p>



<p>在 Ubuntu 上使用sudo运行</p>



<pre class="wp-block-code"><code>apt-get install -y build-essential</code></pre>



<p><strong>验证安装：</strong></p>



<pre class="wp-block-code"><code>node --version
npm --version</code></pre>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<p><strong>第三种从 NVM 安装 Node.js 和 npm</strong></p>



<p>NVM (Node Version Manager) 是一个 Bash 脚本，它允许你为每一个用户管理多个 Node.js 版本。使用 NVM，你可以随时安装或者卸载任何你想要使用或者测试的 Node.js版本。</p>



<p><strong>项目地址：<a href="https://github.com/nvm-sh/nvm" data-type="URL" data-id="https://github.com/nvm-sh/nvm" target="_blank" rel="noreferrer noopener">GitHub</a></strong></p>



<p><strong>这里直接使用官方给出的脚本来安装</strong></p>



<pre class="wp-block-code"><code>curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash</code></pre>



<p>或</p>



<pre class="wp-block-code"><code>wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash</code></pre>



<p><strong>安装后关闭当前终端或者按提示复制配置直接运行，如下图所示</strong></p>



<figure class="wp-block-image size-full"><img fetchpriority="high" decoding="async" width="721" height="446" src="https://photo.hishd.top/2023/01/20230130213058632.png" alt="" class="wp-image-198"/></figure>



<p><strong>验证：</strong></p>



<pre class="wp-block-code"><code>nvm --version</code></pre>



<p><strong>列出当前可用的版本（如需要选择版本，安装最新版本的话可以跳过列出）</strong></p>



<pre class="wp-block-code"><code>nvm list-remote</code></pre>



<p><strong>安装最新可用的 Node.js</strong></p>



<pre class="wp-block-code"><code>nvm install node</code></pre>



<figure class="wp-block-image size-full"><img decoding="async" width="972" height="199" src="https://photo.hishd.top/2023/01/20230130214351301.png" alt="" class="wp-image-199"/></figure>



<p><strong>验证当前安装的版本：</strong></p>



<pre class="wp-block-code"><code>node --version</code></pre>



<p>或者可以<strong>列出当前nvm的版本</strong></p>



<pre class="wp-block-code"><code>nvm ls</code></pre>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<p>以上的三种方法各有各的优势和优点，可以自行选择不同的方式来安装node和npm。不过国内的机器访问GitHub可能会有点慢或者无法访问</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.hishd.top/archives/196/feed</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
