最近在学习vue.js,写下笔记
一、安装npm及cnpm
1、安装node
https://nodejs.org/dist/latest/
选择:node-v13.3.0-x64.msi
会继续安装必要工具
把node.exe所在目录加入path环境变量中
>node --version
(v13.3.0)
2、安装git
(略过)
>git --version
(git version 2.18.0.windows.1)
3、安装npm
>d:
>cd vue
>git config --system http.sslcainfo/bin/curl-ca-bundle.crt
>git clone --recursive git://github.com/isaacs/npm.git
>cd npm
>npm --version
4、安装cnpm
>cd ..
>npm install -g cnpm --registry=https://registry.npm.taobao.org
二、使用VueCli快速构建项目
>cnpm install vue-cli -g
>vue --version
创建项目:
>d:
>cd vue\project
>vue init webpack new01
(配置如下)
>cd new01
>cnpm install
>npm start
在浏览器输入:http://localhost:8080 访问
然后在另一个控制台,输入
>d:
>cd vue\project\new01
>npm run build
这样就创建了一个HelloWorld项目