vue学习笔记 二、环境搭建+项目创建
|
系列导航 |
||
|---|---|---|
一、官网下载安装 相当于jdk
注:参照第一篇博客
https://www.cnblogs.com/yclh/p/15341868.html
查看版本
D:\>node -v
v14.17.5
安装后自带npm
C:\Windows\system32>npm -v
6.14.15
二、安装cnpm
1、C:\Windows\system32> npm install -g cnpm --registry=https://registry.npm.taobao.org/
注:registry=https://registry.npm.taobao.org/ 指定使用淘宝的源
2、安装成功后查看cnpm的版本
C:\Windows\system32>cnpm -v
cnpm@7.0.0 (C:\Users\yc\AppData\Roaming\npm\node_modules\cnpm\lib\parse_argv.js)
npm@6.14.15 (C:\Users\yc\AppData\Roaming\npm\node_modules\cnpm\node_modules\npm\lib\npm.js)
node@14.17.6 (D:\soft\nodejs\node.exe)
npminstall@5.0.2 (C:\Users\yc\AppData\Roaming\npm\node_modules\cnpm\node_modules\npminstall\lib\index.js)
prefix=C:\Users\yc\AppData\Roaming\npm
win32 x64 10.0.19042
registry=https://registry.nlark.com
三、 安装vue的环境
D:\>cnpm i -g vue @vue/cli
D:\>vue --version
@vue/cli 4.5.13
四、创建项目
1、进入D:/soft,创建firstdemo项目
D:\soft>vue create firstdemo
2、如下选择Manually select features 回车
Vue CLI v4.5.13
? Please pick a preset:
Default ([Vue 2] babel, eslint)
Default (Vue 3) ([Vue 3] babel, eslint)
> Manually select features
3、选择如下,上下光标 按空格选择 选好后回车进入下一步
Vue CLI v4.5.13
? Please pick a preset: Manually select features
? Check the features needed for your project:
(*) Choose Vue version
(*) Babel
( ) TypeScript
( ) Progressive Web App (PWA) Support
(*) Router
(*) Vuex
(*) CSS Pre-processors
>( ) Linter / Formatter
( ) Unit Testing
( ) E2E Testing
4、选择版本 使用3.x的版本
? Please pick a preset: Manually select features
? Check the features needed for your project: Choose Vue version, Babel, Router, Vuex, CSS Pre-processors
? Choose a version of Vue.js that you want to start the project with
2.x
> 3.x
5、输入Y 回车
Vue CLI v4.5.13
? Please pick a preset: Manually select features
? Check the features needed for your project: Choose Vue version, Babel, Router, Vuex, CSS Pre-processors
? Choose a version of Vue.js that you want to start the project with 3.x
? Use history mode for router? (Requires proper server setup for index fallback in production) (Y/n) y
6、选择Sass/SCSS (with dart-sass)(默认) 回车
? Please pick a preset: Manually select features
? Check the features needed for your project: Choose Vue version, Babel, Router, Vuex, CSS Pre-processors
? Choose a version of Vue.js that you want to start the project with 3.x
? Use history mode for router? (Requires proper server setup for index fallback in production) Yes
? Pick a CSS pre-processor (PostCSS, Autoprefixer and CSS Modules are supported by default): (Use arrow keys)
> Sass/SCSS (with dart-sass)
Sass/SCSS (with node-sass)
Less
Stylus
7、选择In dedicated config files(默认)回车
? Please pick a preset: Manually select features
? Check the features needed for your project: Choose Vue version, Babel, Router, Vuex, CSS Pre-processors
? Choose a version of Vue.js that you want to start the project with 3.x
? Use history mode for router? (Requires proper server setup for index fallback in production) Yes
? Pick a CSS pre-processor (PostCSS, Autoprefixer and CSS Modules are supported by default): Sass/SCSS (with dart-sass)
? Where do you prefer placing config for Babel, ESLint, etc.? (Use arrow keys)
> In dedicated config files
In package.json
8、是否对之前的选择 设置一个预设名 如果选择Y了就要输入一个名字,下载在创建的时候第2步那里就会出现这里的预设名。不需要直接输入N即可
? Please pick a preset: Manually select features
? Check the features needed for your project: Choose Vue version, Babel, Router, Vuex, CSS Pre-processors
? Choose a version of Vue.js that you want to start the project with 3.x
? Use history mode for router? (Requires proper server setup for index fallback in production) Yes
? Pick a CSS pre-processor (PostCSS, Autoprefixer and CSS Modules are supported by default): Sass/SCSS (with dart-sass)
? Where do you prefer placing config for Babel, ESLint, etc.? In dedicated config files
? Save this as a preset for future projects? (y/N) N
等待项目的创建……
9、进入创建的项目运行起来
D:\soft\ firstdemo > npm run serve
启动成功后返回
DONE Compiled successfully in 1774ms 上午10:37:43
App running at:
- Local: http://localhost:8080/
- Network: http://172.31.144.8:8080/
Note that the development build is not optimized.
To create a production build, run npm run build.
10、浏览器打开 http://localhost:8080/

看到这个恭喜恭喜,证明项目创建成功。
推荐一个适合零基础学习SQL的网站:不用安装数据库,在线轻松学习SQL!
vue学习笔记 二、环境搭建+项目创建的更多相关文章
- 前端框架vue学习笔记:环境搭建
兼容性 不兼容IE8以下 Vue Devtools 能够更好的对界面进行审查和调试 环境搭建 1.nodejs(新版本的集成了npm)[npm是node包管理 node package manager ...
- vue学习笔记:环境搭建
一.安装node.js node.js的官方地址为:https://nodejs.org/en/download/ 下载好安装包点击安装,基本就是下一步.下一步.... 安装完成后可以通过以下两种方式 ...
- Mybatis-Plus 实战完整学习笔记(二)------环境搭建
第二章 使用实例 1.搭建测试数据库 -- 创建库 CREATE DATABASE mp; -- 使用库 USE mp; -- 创建表 CREATE TABLE tbl_employee( ...
- 从零开始学Xamarin.Forms(二) 环境搭建、创建项目
原文:从零开始学Xamarin.Forms(二) 环境搭建.创建项目 一.环境搭建 Windows下环境搭建: 1.下载并安装jdk.Android SDK和NDK,当然还需要 VS2013 ...
- Android Studio 学习笔记(一)环境搭建、文件目录等相关说明
Android Studio 学习笔记(一)环境搭建.文件目录等相关说明 引入 对APP开发而言,Android和iOS是两大主流开发平台,其中区别在于 Android用java语言,用Android ...
- 【Django学习笔记】-环境搭建
对于初学django新手,根据以下步骤可以快速进行Django环境搭建 虚拟环境创建 使用virtualenv创建并启用虚拟机环境 ,关于virtualenv可参考https://www.yuque. ...
- Vue学习笔记一:使用vue-cli 创建开发环境
第一步:安装Node.js 点击此处下载 选择对应的安装包,进行安装. 第二步:安装淘宝镜像 有一个问题,使用 npm 会导致网速很慢,对于大陆用户,建议将 npm 的注册表源设置为国内的镜像, ...
- 从零開始学Xamarin.Forms(二) 环境搭建、创建项目
一.环境搭建 Windows下环境搭建: 1.下载并安装jdk.Android SDK和NDK.当然还须要 VS2013 update 2(VS2010.VS2012均可)以上. a. 最新 ...
- Vue(一)环境搭建、创建项目
1.安装node和npm 因为node已经有npm,所以直接安装node,配置环境变量 官网地址:http://nodejs.cn/download/ 2.查看node是否安装成功,输入名nde -v ...
- Django学习笔记 开发环境搭建
为什么使用django?1.支持快速开发:用python开发:数据库ORM系统,并不需要我们手动地构造SQL语句,而是用python的对象访问数据库,能够提升开发效率.2.大量内置应用:后台管理系统a ...
随机推荐
- charles谷歌浏览器抓包方法
charles谷歌浏览器抓包方法 在工作中,我们会在PC电脑上测试页面,查看后端接口,我们会选择浏览器F12的功能来查看后端请求的接口,那我们能不能用charles抓包工具去抓呢?下面简答介绍一下ch ...
- 编辑linux服务启动命令(app-script.sh命令编写)
#!/bin/sh# 注:这里可替换为你自己的执行程序,其他代码无需更改APP_NAME=app-biz.jar #使用说明,用来提示输入参数usage() { echo "Usage: s ...
- 使用nacos配置,启动服务时一直报 Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled. APPLICATION FAILED TO START
报错日志如下: Error starting ApplicationContext. To display the conditions report re-run your application ...
- 【Linux API 揭秘】container_of函数详解
[Linux API 揭秘]container_of函数详解 Linux Version:6.6 Author:Donge Github:linux-api-insides 1.container_o ...
- C#_Win32_PInvoke源码生成器
介绍 一个源代码生成器,用于向 C#项目添加一组用户定义的 Win32 P/Invoke 方法和相关的类型. 链接地址: https://github.com/microsoft/CsWin32 还在 ...
- Windows系统激活工具HK
下载:https://wwsi.lanzoum.com/iyUNn10e7foh 密码:g05d GitHub开源 .无毒 原文链接:https://github.com/zbezj/HEU_KMS_ ...
- 从零玩转QQ登录-clwzqqdlu
title: 从零玩转QQ登录 date: 2021-05-01 15:55:39.951 updated: 2023-03-30 13:29:03.865 url: https://www.yby6 ...
- Python——第一章:if语法规则
if语句的语法规则: ======第一种====== if 条件: 代码 如果条件成立就执行代码 如果不成立, 就不执行 案例1: mo ...
- 2023年资深C#开发者的思考
2023年转眼间就这样过掉了,作为一名资深C#的开发员人员,年龄也大了1岁,从最早接触C#开始,算下来已经超过15年以上了,随着工作经验的不断增加,物价不断的飞涨以及家庭支出的不断上涨,工作1份工资已 ...
- Spring 事务的实现原理
在执行访问数据库相关的操作中,特别是针对数据的修改操作,由于对于数据的修改可能会出现异常,因此对于整个一组的数据修改实际上都不能算是生效的,在这种情况下,需要使用事务的 "回滚" ...