前提条件:已经搭建了 node 环境,nodejs是当下前端工程化开发必不可少的环境, 使用 nodejs 的 npm 功能来管理依赖包
npm是非常重要的npm管理工具,由于npm的服务器位于国外, 所以一般建议 将 npm设置成国内的淘宝镜像,在终端中执行以下命令
$ npm config set registry https://registry.npm.taobao.org/ #设置淘宝镜像地址
查看当前 npm 的镜像地址
$ npm config get registry #查看镜像地址