回到技术博客

VuePress初体验

安装Yarn

Yarn 是为了弥补 npm 的一些缺陷而生的

具体参考:https://zhuanlan.zhihu.com/p/27449990

引导式安装

下载地址

使用Windows版的下载安装即可

bash安装

在bash里面不能显示,在bash里面下载

npm install -g yarn 即可

将 VuePress 安装为本地依赖

yarn init

yarn init 出错

error An unexpected error occurred: "Can't answer a question unless a user TTY". info If you think t

使用cmd或者power shell不要使用bash

yarn add -D vuepress

创建一篇文章

在bash创建,在powershell里面创建会报错

mkdir docs && echo '# Hello VuePress' > docs/README.md

添加脚本

{
  "name": "my-site",
  "version": "1.0.0",
  "main": "index.js",
  "license": "MIT",
  "devDependencies": {
    "vuepress": "^1.7.1"
  },
  "scripts": {
    "docs:dev": "vuepress dev docs",
    "docs:build": "vuepress build docs"
  }
}

运行

端口访问:http://localhost:8080/

— 写于生活,留给未来 —

最后更新于 2024-11-17

树下留言

LET’S TALK

文字是一次相遇。很高兴听到你的声音。

评论加载中…