1200字范文,内容丰富有趣,写作的好帮手!
1200字范文 > Mac OS下搭建Vue开发环境

Mac OS下搭建Vue开发环境

时间:2023-01-22 23:10:57

相关推荐

Mac OS下搭建Vue开发环境

作者 李明明

转载请注明出处:/p/38a7564e84cc

前言

原来一直学习使用React,现在因为工作的需要,对Vue进行学习和使用,现在比较流行的框架React,angular,vue,正好对于vue也进行些了解。

环境搭建

打开终端,安装brew

usr/bin/ruby -e "$(curl -fsSL /Homebrew/install/master/install)"

安装成功后,使用查看版本,验证是否安装成功

brew -v

2. 安装node.js

brew install nodejs

也可以下载安装下载地址

安装成功后,使用验证

node -v

给nodejs目录赋权限

sudo chmod -R 777 /usr/local/lib/node_modules/

安装 淘宝镜像 (npm)

npm install -g cnpm --registry=https://registry.

安装webpack

cnpm install webpack -g

安装vue脚手架

npm install vue-cli -g

开始Vue

# 创建一个基于 webpack 模板的新项目$ vue init webpack my-project# 这里需要进行一些配置,默认回车即可This will install Vue 2.x version of the template.For Vue 1.x use: vue init webpack#1.0 my-project? Project name my-project? Project description A Vue.js project? Author runoob <test@>? Vue build standalone? Use ESLint to lint your code? Yes? Pick an ESLint preset Standard? Setup unit tests with Karma + Mocha? Yes? Setup e2e tests with Nightwatch? Yesvue-cli · Generated "my-project".To get started:cd my-projectnpm installnpm run devDocumentation can be found at https://vuejs-templates.github.io/webpack

进入项目,安装并运行:

$ cd my-project$ cnpm install$ cnpm run devDONE Compiled successfully in 4388ms> Listening at http://localhost:8080

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。