大家都知道国内直接使用 ​​npm​​​的官方镜像是非常慢的,这里推荐使用淘宝​​NPM​​ 镜像。

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

这样就可以使用​​cnpm​​命令来安装模块了:

cnpm install [name]
cnpm i [name]

安装项目依赖:一定要从官方仓库安装,​​npm​​服务器在国外所以这一步安装速度会很慢。

npm install

不要从国内镜像​​cnpm​​安装(会导致后面缺了很多依赖库)

cnpm install