windows10 node12 vue/cli 4.5.11 vue2 yarn环境搭建

1.安装node.js

https://npm.taobao.org/mirrors/node/v12.18.3/

https://npm.taobao.org/mirrors/node/v12.18.3/node-v12.18.3-x64.msi

2.设置node的全局和缓存路径

在安装目录下新建两个文件夹 node_cache、node_global

npm config set cache "D:\nodejs\node_cache"

npm config set profiles "D:\nodejs\node_global"

3.淘宝镜像

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

4.安装yarn

npm install -g yarn

4.使用yarn安装vue

yarn global add @vue/cli

5.查看yarn安装路径

yarn global dir

6.配置环境变量

7.如果是yarn 的prefix和cache目录

yarn config set global-folder "你的磁盘路径"

yarn config set cache-folder "你的磁盘路径"

8.配置yarn阿里源

yarn config get registry


yarn config set registry https://registry.npm.taobao.org

yarn config set sass_binary_site"https://npm.taobao.org/mirrors/node-sass/"

yarn config set phantomjs_cdnurl"http://cnpmjs.org/downloads"

yarn config set electron_mirror"https://npm.taobao.org/mirrors/electron/"

yarn config set sqlite3_binary_host_mirror"https://foxgis.oss-cn-shanghai.aliyuncs.com/"

yarn config set profiler_binary_host_mirror"https://npm.taobao.org/mirrors/node-inspector/"

yarn config set chromedriver_cdnurl"https://cdn.npm.taobao.org/dist/chromedriver"

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容