vue环境搭建

查看vue版本号:npm list vue
查看vue cli版本号:vue -V
查看node版本号:node -V
查看npm版本号:npm -v
查看各种包的版本:npm info 包名, 如:

		npm info vue-template-compiler
        npm info vue-loader

安装yarn:npm install yarn -g
安装vue cli:yarn global add @vue/cli
node官网:http://nodejs.cn/download/

npm i cnpm -g

npm install vue
yarn add vue -g
vue create projectname

问题:'vue' is not recognized as an internal or external command
解决方法:将“C:\Users\zhong\AppData\Local\Yarn\bin"添加到环境变量path中

YARN
查询当前镜像
yarn config get registry
设置为淘宝镜像
yarn config set registry http://registry.npm.taobao.org/
设置为官方镜像
yarn config set registry https://registry.yarnpkg.com

npm i vue@2.6.11 -g

npm更新包的版本:

更新全局包:

npm update <name> -g

更新生产环境依赖包:

npm update <name> --save

更新开发环境依赖包:

npm update <name> --save-dev

安装vue包

npm install vue

安装vue cli包

npm install -g @vue/cli
# OR
yarn global add @vue/cli
posted @ 2020-01-06 16:08  猫叔1900  阅读(262)  评论(0编辑  收藏  举报