安装NodeJS

查找安装NodeJS

root@hecs-166225:~/.ssh# apt search ^nodejs$
Sorting... Done
Full Text Search... Done
nodejs/stable,now 18.19.0+dfsg-6~deb12u2 amd64 
  evented I/O for V8 javascript - runtime executable

root@hecs-166225:~/.ssh# apt search ^npm$
Sorting... Done
Full Text Search... Done
npm/stable,now 9.2.0~ds1-1 all 
  package manager for Node.js

安装

apt install nodejs npm -y

查看相关版本

root@hecs-166225:~/.ssh# node -v
v18.19.0
root@hecs-166225:~/.ssh# npm -v
9.2.0

安装hexo

执行安装命令

 npm install -g hexo-cli

查看hexo版本

 hexo -v

创建hexo项目目录

 cd /tools/hexo-data

执行初始化

hexo init

生成静态文件

hexo generate

启动hexo

hexo server

访问网页,默认是 http://localhost:4000/

新建一个文档

hexo new learn_blog

查看网页,已经生成learn_blog

参考文档

[1].hexo官网文档

Logo

开源鸿蒙跨平台开发社区汇聚开发者与厂商,共建“一次开发,多端部署”的开源生态,致力于降低跨端开发门槛,推动万物智联创新。

更多推荐