赞
踩
一、创建项目时,提示ohpm没有设置
二、点击Set it up now后,选了了空文件进行安装,但是提示ohpm.zip组件安装失败
三、有可能是因为淘宝镜像变更的原因;
3.1
由于npm官方镜像地址(registry.npmjs.org)在国内访问比较慢,通常国内使用的是淘宝镜像库("https://registry.npm.taobao.org/)。而2021年,淘宝就发文称,npm 淘宝镜像地址从https://registry.npm.taobao.org 切换到了 https://registry.npmmirror.com。旧域名也将于 2022 年 5 月 31 日停止服务。所以使用旧地址的用户会出现证书过期错误提示,导致无法下载。
3.2.1. 在cmd窗口下执行 npm config get registry,查看当前配置的地址
PS D:\workspace\learnui> npm config get registry
npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead.
https://registry.npm.taobao.org/
3.2.2. 清缓存npm cache clean --force
npm cache clean --force
npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead.
npm WARN using --force Recommended protections disabled.
3.2.3.替换为新地址npm config set registry https://registry.npmmirror.com
npm config set registry https://registry.npmmirror.com
npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead.
3.2.4. 检查npm config get registry
npm config get registry
npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead.
https://registry.npmmirror.com/
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。