使用npm配置vue项目历程

1、使用npm配置vue项目历程

1.1、npm安装项目环境很慢

配置国内淘宝镜像

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

指定国内镜像仓下载软件

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

2.2、报错证书过期

清理缓存

npm cache clean --force

禁用SSL

npm config set strict-ssl false

2.3、以上操作后还是报错

指定国内镜像仓下载环境时,使用http访问镜像仓

npm install --registry=http://registry.npm.taobao.org 

注意registryhttp://registry.npm.taobao.org

2、总结

  • 使用npm国内镜像仓安装项目依赖
  • 使用国内镜像仓时,指定http协议(很重要

你可能感兴趣的:(前端开发,npm,vue.js,前端)