win11 安装 Vue

Win 安装 Vue

Vue 官网文档

vue官网

下载 node.js

https://nodejs.org/en
# 安装 v8.9 以上的版本 推荐 v10 及以上
# 我下载的版本9.5.1 版本
链接:https://pan.baidu.com/s/19ekl3NRo4vtfv1Dp5K9kog
提取码:1zoi
一直点击下一步进行安装。 安装到你要的目录即可。

 

查看 npm 版本

打开终端输入
npm --version
9.5.1

 

安装 Vue/cli

# 在 windows 终端输入
npm install -g @vue/cli
# OR
yarn global add @vue/cli

 

 

# 提示我版本太低 需要升级
输入这个命令:
npm install -g npm@9.6.7
# 查看 vue 版本
vue --version
# Vsersion: @vue/cli 5.0.8

 

 

创建一个 Vue 项目

# 可以使用 vue --help 查看帮助
Usage: vue <command> [options]

Options:
-V, --version                              output the version number
 -h, --help                                 display help for command

Commands:
 create [options] <app-name>                create a new project powered by vue-cli-service
 add [options] <plugin> [pluginOptions]     install a plugin and invoke its generator in an already created project
 invoke [options] <plugin> [pluginOptions]  invoke the generator of a plugin in an already created project
 inspect [options] [paths...]               inspect the webpack config in a project with vue-cli-service
 serve                                      alias of "npm run serve" in the current project
 build                                      alias of "npm run build" in the current project
 ui [options]                               start and open the vue-cli ui
 init [options] <template> <app-name>       generate a project from a remote template (legacy API, requires
                                            @vue/cli-init)
 config [options] [value]                   inspect and modify the config
 outdated [options]                         (experimental) check for outdated vue cli service / plugins
 upgrade [options] [plugin-name]           (experimental) upgrade vue cli service / plugins
 migrate [options] [plugin-name]           (experimental) run migrator for an already-installed cli plugin
 info                                       print debugging information about your environment
 help [command]                             display help for command

 Run vue <command> --help for detailed usage of given command.

 

 

# 创建 vue 项目
vue create hello-world
# 你也可以使用图形话来创建项目
vue ui

# 选择你要创建的版本即可!

 

启动

cd hello-world [你上面创建的文件名]
npm run serve

# 默认端口 浏览器访问 http://ip:8080
# 或者 localhost:8080
# 这样 vue 就搭建完成了

 

 

 

 

 

 

 

 

posted @ 2023-06-06 15:35  Handsome、Snake  阅读(330)  评论(0编辑  收藏  举报