Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
RunnerMonster opened this issue Mar 25, 2024 · 13 comments

Comments

@RunnerMonster
Copy link

🧐 问题描述 | 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
Copy link
Author

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

@mayongkang1
Copy link

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

@BunnkeiKou
Copy link

BunnkeiKou commented Apr 18, 2024

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

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

@Mcggvc
Copy link

Mcggvc commented Apr 18, 2024

请问解决了吗

@mx52jing
Copy link

mx52jing commented May 8, 2024

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

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

@cmk12345
Copy link

同样的情况,还没解决

@mx52jing
Copy link

兄弟们,我解决了,记住这个包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
Copy link

同样的情况,还没解决

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

@youngtooyoung
Copy link

同样的情况,还没解决

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

解决了,非常感谢

@Tao66
Copy link

Tao66 commented Aug 9, 2024

相同的情况,尚未解决

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

大佬厉害啊,已成功解决

@funnymadpia
Copy link

解决了哥们,我的神!

@dcgchina
Copy link

https://registry.npmmirror.com/

同样的情况,还没解决

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

卧槽,哥们你太帅了。

@coldwolfwave
Copy link

大佬太牛了,照着一步步来直接解决了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests