HarmonyOS 鸿蒙Next最新版新建项目就出现reason: certificate has expired

发布于 1周前 作者 sinazl 来自 鸿蒙OS

HarmonyOS 鸿蒙Next最新版新建项目就出现reason: certificate has expired

https://alliance-communityfile-drcn.dbankcdn.com/FileServer/getFile/cmtybbs/487/758/241/2850086000487758241.20241024162207.43198754367558666411358036366043:50001231000000:2800:6B13AFAD36CAE074FEEC8F1D1728D4C544A3D645C3EBE4BDDA4727AFBCC82AF7.jpg

最新版新建项目就出现reason: certificate has expired

0 verbose cli D:\Program Files\Huawei\DevEco Studio\tools\node\node.exe D:\Program Files\Huawei\DevEco Studio\tools\node\node_modules\npm\bin\npm-cli.js
1 info using npm@10.5.0
2 info using node@v18.20.1
3 timing npm:load:whichnode Completed in 2ms
4 timing config:load:defaults Completed in 2ms
5 timing config:load:file:D:\Program Files\Huawei\DevEco Studio\tools\node\node_modules\npm\npmrc Completed in 2ms
6 timing config:load:builtin Completed in 2ms
7 timing config:load:cli Completed in 1ms
8 timing config:load:env Completed in 1ms
9 timing config:load:file:C:\Users\Administrator\.hvigor\wrapper\tools\.npmrc Completed in 0ms
10 timing config:load:project Completed in 2ms
11 timing config:load:file:C:\Users\Administrator\.npmrc Completed in 1ms
12 timing config:load:user Completed in 1ms
13 timing config:load:file:D:\Program Files\Huawei\DevEco Studio\tools\node\etc\npmrc Completed in 0ms
14 timing config:load:global Completed in 0ms
15 timing config:load:setEnvs Completed in 1ms
16 timing config:load Completed in 10ms
17 timing npm:load:configload Completed in 10ms
18 timing config:load:flatten Completed in 2ms
19 timing npm:load:mkdirpcache Completed in 0ms
20 timing npm:load:mkdirplogs Completed in 1ms
21 verbose title npm install pnpm
22 verbose argv "install" "pnpm"
23 timing npm:load:setTitle Completed in 0ms
24 timing npm:load:display Completed in 0ms
25 verbose logfile logs-max:10 dir:C:\Users\Administrator\AppData\Local\npm-cache\_logs\2024-10-24T08_10_45_586Z-
26 verbose logfile C:\Users\Administrator\AppData\Local\npm-cache\_logs\2024-10-24T08_10_45_586Z-debug-0.log
27 timing npm:load:logFile Completed in 8ms
28 timing npm:load:timers Completed in 0ms
29 timing npm:load:configScope Completed in 0ms
30 timing npm:load Completed in 41ms
31 timing arborist:ctor Completed in 0ms
32 silly logfile start cleaning logs, removing 4 files
33 timing arborist:ctor Completed in 0ms
34 timing idealTree:init Completed in 12ms
35 timing idealTree:userRequests Completed in 3ms
36 silly idealTree buildDeps
37 silly fetch manifest pnpm@8.13.1
38 silly logfile done cleaning log files
39 silly placeDep ROOT pnpm@ OK for:  want: 8.13.1
40 timing idealTree:#root Completed in 70136ms
41 timing idealTree:node_modules/pnpm Completed in 0ms
42 timing idealTree:buildDeps Completed in 70137ms
43 timing idealTree:fixDepFlags Completed in 0ms
44 timing idealTree Completed in 70153ms
45 timing command:install Completed in 70161ms
46 verbose type system
47 verbose stack FetchError: request to https://registry.npm.taobao.org/pnpm failed, reason: certificate has expired
47 verbose stack     at ClientRequest.<anonymous> (D:\Program Files\Huawei\DevEco Studio\tools\node\node_modules\npm\node_modules\minipass-fetch\lib\index.js:130:14)
47 verbose stack     at ClientRequest.emit (node:events:517:28)
47 verbose stack     at _destroy (node:_http_client:882:13)
47 verbose stack     at onSocketNT (node:_http_client:902:5)
47 verbose stack     at process.processTicksAndRejections (node:internal/process/task_queues:83:21)
48 verbose cwd C:\Users\Administrator\.hvigor\wrapper\tools
49 verbose Windows_NT 10.0.17763
50 verbose node v18.20.1
51 verbose npm  v10.5.0
52 error code CERT_HAS_EXPIRED
53 error errno CERT_HAS_EXPIRED
54 error request to https://registry.npm.taobao.org/pnpm failed, reason: certificate has expired
55 verbose exit 1
56 timing npm Completed in 70477ms
57 verbose unfinished npm timer reify 1729757445900
58 verbose unfinished npm timer reify:loadTrees 1729757445905
59 verbose code 1
60 error A complete log of this run can be found in: C:\Users\Administrator\AppData\Local\npm-cache\_logs\2024-10-24T08_10_45_586Z-debug-0.log

更多关于HarmonyOS 鸿蒙Next最新版新建项目就出现reason: certificate has expired的实战系列教程也可以访问 https://www.itying.com/category-93-b0.html

2 回复

是npm的问题,执行* npm config set strict-ssl false 禁用SSL证书验证

更多关于HarmonyOS 鸿蒙Next最新版新建项目就出现reason: certificate has expired的实战系列教程也可以访问 https://www.itying.com/category-93-b0.html


针对您提出的HarmonyOS(鸿蒙)Next最新版在新建项目时出现“reason: certificate has expired”的问题,这通常是由于项目配置中使用的证书已经过期所导致的。以下是一些可能的解决方案:

  1. 检查系统时间:首先确认您的开发设备系统时间是否准确。错误的系统时间可能导致证书验证失败,特别是当系统时间早于证书有效期开始时或晚于证书有效期结束时。

  2. 更新证书:如果项目中使用了特定的开发证书或调试证书,请检查这些证书的有效期,并在必要时从相关颁发机构获取新的证书。

  3. 清理项目配置:有时候,旧的项目配置或缓存可能会导致此类问题。尝试清理项目配置和缓存,然后重新构建项目。

  4. 检查依赖库:如果您的项目依赖于外部库或框架,请确保这些依赖也是最新的,并且它们所使用的证书也是有效的。

  5. 重启开发环境:有时候,简单的重启IDE或开发环境可以解决一些莫名其妙的问题。

如果上述方法都无法解决问题,那么可能是鸿蒙系统或开发工具的bug,或者是项目配置中的其他未知问题。此时,建议您直接联系官网客服以获取更专业的帮助。官网地址是:https://www.itying.com/category-93-b0.html

回到顶部