ant-design / ant-design-pro

👨🏻‍💻👩🏻‍💻 Use Ant Design like a Pro!
https://pro.ant.design
MIT License
36.31k stars 8.14k forks source link

🧐[问题 | question]大佬们好,我在使用umi ui创建页面时点击创建,webstorm就会报错,证书已过期。找过相关资料没有解决掉。 #11193

Open RunnerMonster opened 5 months ago

RunnerMonster commented 5 months ago

🧐 问题描述 | Problem description

使用umi ui创建模板的时候,一点击创建,webstorm就会断开报错 FetchError: request to https://registry.npm.taobao.org/ failed, reason: certificate has expired

💻 示例代码 | Sample code

C:\Users\LongTwo\Desktop\CodeSpace\星球项目\CodeOne\user-center-frontend\node_modules\node-fetch\lib\index.js:1501 reject(new FetchError(request to ${request.url} failed, reason: ${err.message}, 'system', err)); ^ FetchError: request to https://registry.npm.taobao.org/ failed, reason: certificate has expired at ClientRequest. (C:\Users\LongTwo\Desktop\CodeSpace\星球项目\CodeOne\user-center-frontend\node_modules\node-fetch\lib\index.js:1501:11) at ClientRequest.emit (node:events:513:28) at TLSSocket.socketErrorListener (node:_http_client:494:9) at TLSSocket.emit (node:events:513:28) at emitErrorNT (node:internal/streams/destroy:157:8) at emitErrorCloseNT (node:internal/streams/destroy:122:3) at processTicksAndRejections (node:internal/process/task_queues:83:21) { type: 'system', errno: 'CERT_HAS_EXPIRED', code: 'CERT_HAS_EXPIRED' } Done in 210.81s.

🚑 其他信息 | Other information

显示证书过期,csdn,和issue中没有找到类似的问题。

Snipaste_2024-03-25_17-25-46 Snipaste_2024-03-25_17-31-16

windows:10 Node:nvm 16.20.0 浏览器 | browser:edge

RunnerMonster commented 5 months ago

尝试过修改镜像源为其他的https://registry.npmjs.org/,但是一旦生成模板的那步,又报错说https://registry.npm.taobao.org/ 证书过期。难道我修改了镜像源,这个项目没有去访问吗?

mayongkang1 commented 5 months ago

是的,淘宝镜像域名过期了 1、npm config get registry // 检查当前的镜像是什么 2、npm cache clean --force // 清空缓存 3、npm config set registry https://registry.npmmirror.com //切换新的镜像

BunnkeiKou commented 4 months ago

尝试过修改镜像源为其他的https://registry.npmjs.org/,但是一旦生成模板的那步,又报错说https://registry.npm.taobao.org/ 证书过期。难道我修改了镜像源,这个项目没有去访问吗?

(我也遇到了同样的问题,朋友你找到解决方法了吗,附加,我还使用了npmmirror-quick[https://www.npmjs.com/package/npmmirror-quick],也没有用

Mcggvc commented 4 months ago

请问解决了吗

mx52jing commented 4 months ago

是的,淘宝镜像域名过期了 1、npm config get registry // 检查当前的镜像是什么 2、npm cache clean --force // 清空缓存 3、npm config set registry https://registry.npmmirror.com //切换新的镜像

试了下这样没用呢,搜了一些资料也没用

cmk12345 commented 3 months ago

同样的情况,还没解决

mx52jing commented 1 month ago

兄弟们,我解决了,记住这个包getnpmregistry,看下你们的node_modules下面的这个包,里面有个registryMap字段,里面配置了taobao

const registryMap = {
  taobao: "https://registry.npmmirror.com/",
  npm: "https://registry.npmjs.org"
};

taobao源改成https://registry.npmmirror.com/就可以了

⚠️注意下:如果你用的是pnpm你还要去node_modules下面的.pnpm目录下面找getnpmregistry这个包,看下里面的taobao源配置的对不对,有可能node_modules/getnpmregistry/index.js里面的配置和node_modules/.pnpm/getnpmregistry@1.0.1/node_modules/getnpmregistry/index.js的不一致

image image
mx52jing commented 1 month ago

同样的情况,还没解决

试下我提供的这个方案,看能解决不

youngtooyoung commented 1 month ago

同样的情况,还没解决

试下我提供的这个方案,看能解决不

解决了,非常感谢

Tao66 commented 3 weeks ago

相同的情况,尚未解决

尝试下我提供的这个方案,看看能解决不

大佬厉害啊,已成功解决

funnymadpia commented 3 weeks ago

解决了哥们,我的神!

dcgchina commented 2 weeks ago

https://registry.npmmirror.com/

同样的情况,还没解决

试下我提供的这个方案,看能解决不

卧槽,哥们你太帅了。