文章目录
Vue学习 之 MacOS 安装 vue-cli
vue-cli 简介
vue-cli(Vue Command Line Interface)是Vue.js官方提供的一个脚手架工具,它提供了一些命令,可以帮助我们创建基于Vue.js的项目模板,快速开发Vue.js单页面应用(SPA)。使用vue-cli可以配置构建工具、插件、路由、状态管理等等,可以大大提升开发效率,减少重复操作。
vue-cli 安装
vue-cli 的安装需要先安装 Node.js 和 npm,建议先安装好 Node.js 和 npm 后再进行下面的安装步骤。
在命令行窗口中输入以下命令可以全局安装 vue-cli:
sudonpminstall-g vue-cli
回车后需输入密码。
安装完成后可以通过以下命令验证是否安装成功:
vue -V
如果正确显示版本号,则说明安装成功。
完整步骤如下:
➜ ~ sudonpminstall-g vue-cli
Password:
npm WARN deprecated [email protected]: This package has been deprecated in favour of @vue/cli
npm WARN deprecated [email protected]: Please upgrade to version 7 or higher. Older versions may use Math.random()in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.
npm WARN deprecated [email protected]: this library is no longer supported
npm WARN deprecated [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated [email protected]: Please upgrade to consolidate v1.0.0+ as it has been modernized with several long-awaited fixes implemented. Maintenance is supported by Forward Email at https://forwardemail.net ; follow/watch https://github.com/ladjs/consolidate for updates and release changelog
npm WARN deprecated [email protected]: CoffeeScript on NPM has moved to "coffeescript"(no hyphen)
added 234 packages in 15s
11 packages are looking for funding
run `npm fund`for details
➜ ~ vue -V2.9.6
➜ ~
注意安装时需要使用
sudo npm install -g vue-cli
命令,使用其他命令可能会报权限错误的问题。
版权归原作者 Morris_ 所有, 如有侵权,请联系我们删除。