Mac/Linux下搭建Vue项目

来源:互联网 发布:chinanet免费连接软件 编辑:程序博客网 时间:2024/06/07 17:19

1.安装NodeJS

2.更改npm源


# 第一种方法
$ npm config set registry https://registry.npm.taobao.org
# 查看npm基本配置信息,验证是否生效
$ npm config list
# 第二种方法,该方法可以用cnpm来替代npm命令
$ npm install -g cnpm -registry=https://registry.npm.taobao.org


3.安装Vue脚手架

# install vue-cli
$ npm install --global vue-cli
# create a new project using the "webpack" template
$ vue init webpack testvue
init命令执行完后会出现以下的自定义项,可根据自己的组要设置



# install dependencies and go!
$ cd TestVue
$ npm install
$ npm run dev
浏览器输入http://127.0.0.1:8080,完成。

原创粉丝点击