Windows下安装Vue

本文详细介绍了在Windows操作系统中安装Vue的步骤,包括从下载Node.js安装包到设置全局模块路径,安装cnpm(淘宝镜像),配置环境变量,直至最后安装Vue和vue-cli脚手架,为开发者提供了一站式的Vue开发环境搭建教程。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

一.下载安装包

前往Node.js官网下载:添加链接描述
在这里插入图片描述
下载如下:
在这里插入图片描述
双击执行安装,指定安装路径:
在这里插入图片描述
默认按安装全部组件:
在这里插入图片描述
安装成功:
在这里插入图片描述

二.设置nodejs prefix(全局)和cache(缓存)路径

1.在nodejs安装路径下,新建node_global和node_cache两个文件夹
在这里插入图片描述
2.设置缓存文件路径和全局模块存放路径
在这里插入图片描述

三.基于 Node.js 安装cnpm(淘宝镜像)

在这里插入图片描述

四.设置环境变量

设置环境变量可以使得在任意目录下都可以使用cnpm、vue等命令,而不需要输入全路径
1.鼠标右键"此电脑",选择“属性”菜单,在弹出的“系统”对话框中左侧选择“高级系统设置”,弹出“系统属性”对话框。修改系统变量PATH:
在这里插入图片描述
2.新增系统变量NODE_PATH
在这里插入图片描述

五.安装Vue

在这里插入图片描述

六.安装vue命令行工具,即vue-cli 脚手架

C:\Users\Administrator>npm install -g @vue/cli-service-global
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated chokidar@2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
npm WARN deprecated fsevents@1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.

> yorkie@2.0.0 install D:\Users\Administrator\nodejs\node_global\node_modules\@vue\cli-service-global\node_modules\yorkie
> node bin/install.js

setting up Git hooks
trying to install from sub 'node_module' directory, skipping Git hooks installation

> core-js@3.6.5 postinstall D:\Users\Administrator\nodejs\node_global\node_modules\@vue\cli-service-global\node_modules\core-js
> node -e "try{require('./postinstall')}catch(e){}"

Thank you for using core-js ( https://github.com/zloirock/core-js ) for polyfilling JavaScript standard library!

The project needs your help! Please consider supporting of core-js on Open Collective or Patreon:
> https://opencollective.com/core-js
> https://www.patreon.com/zloirock

Also, the author of core-js ( https://github.com/zloirock ) is looking for a good job -)


> ejs@2.7.4 postinstall D:\Users\Administrator\nodejs\node_global\node_modules\@vue\cli-service-global\node_modules\ejs
> node ./postinstall.js

Thank you for installing EJS: built with the Jake JavaScript build tool (https://jakejs.com/)

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.2.7 (node_modules\@vue\cli-service-global\node_modules\chokidar\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

+ @vue/cli-service-global@4.3.1
added 1253 packages from 861 contributors in 359.141s

至此,Vue已经安装完成,下一步将创建项目!

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值