由create-react-app 过程慢引出的问题npm使用汇总

468 阅读1分钟

使用create-react-app 按照默认使用方式,体感不是很爽

问题1. 感觉很慢,半天都不动

问题2. 使用了create-react-app的全局命令创建的话,会提示‘We no longer support global installation of Create React App’

解决问题1 可以采用更改npm镜像源,最好是使用nrm更改(方便)

-------稍微介绍下nrm--------

全称是npm registry manager,即npm的镜像源管理工具

1 nrm ls 列出可使用的npm 镜像源

2 nrm use tencent 更改为腾讯镜像,现在不建议使用taobao镜像了, 因为taobao 是//registry.npmmirror.com/ ,会很慢

3 nrm add registry_name http://url 添加自定义的源

4 nrm del registry_name 删除镜像源

5 nrm test registry_name 测试相应源的响应时间

解决问题2, 使用npx create-react-app 就好