美文网首页
vue-cli 创建一个项目

vue-cli 创建一个项目

作者: 吃萝卜的小兔子 | 来源:发表于2017-12-15 13:11 被阅读0次

1. 下载并安装node.js LTS版本(不然创建vue-cli项目时会卡在输入项目名称那里下不去)
安装完后 node-v npm -v 检查是否安装好了

2. 安装vue-cli
直接安装:npm install -g vue-cli
镜像安装:npm install -g cnpm --registry=https://registry.npm.taobao.org
查看是否安装好了: cnpm -v
安装vue-cli: cnpm install -g vue-cli
安装失败:npm cache clean(清理缓存,然后重新安装)
查看是否安装好: vue -V

3.创建一个项目
创建命令:vue init webpack Vue-Project(exp: test) (ps:必须英文)

? Project name test           // 项目名称
? Project description A Vue.js project              // 项目描述
? Author limy                                      // 项目作者
? Vue build standalone            // 打包方式
? Install vue-router? Yes          // 是否用路由
? Use ESLint to lint your code? Yes     // 严格模式
? Pick an ESLint preset Standard        // 选择一个ESLint预设的标准
? Set up unit tests No         // 是否单元测试
? Setup e2e tests with Nightwatch? No   / / 是否单元测试
? Should we run `npm install` for you after the project has been created? (recommended) npm    // 加载依赖 

ps: 如果没有最后一个选项 就进入项目里
执行安装依赖的命令:npm install 或者 cnpm install

image.png
创建成功后,输入网址就可以看到项目主页了
image.png
image.png

相关文章

网友评论

      本文标题:vue-cli 创建一个项目

      本文链接:https://www.haomeiwen.com/subject/nsgrwxtx.html