✖ Failed to install modules: ["@electron-forge/plugin-vite@^7.2.0","@typescript-eslint/eslint-plugin@^5.0.0","@typescript-eslint/parser@^5.0.0","eslint@^8.0.1","… With output: Command failed with a non-zero return code (1): yarn add @electron-forge/plugin-vite@^7.2.0 @typescript-eslint/eslint-plugin@^5.0.0 @typescript-eslint/parser@^5.0.0 eslint@^8.0.1 eslint-plugin-import@^2.25.0… yarn add v1.22.21 info No lockfile found. [1/4] Resolving packages... info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command. (node:89705) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead. (Use `node --trace-deprecation ...` to show where the warning was created) error Error: certificate has expired at TLSSocket.onConnectSecure (node:_tls_wrap:1674:34) at TLSSocket.emit (node:events:515:28) at TLSSocket._finishInit (node:_tls_wrap:1085:8) at ssl.onhandshakedone (node:_tls_wrap:871:12) (node:89705) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead. (Use `node --trace-deprecation ...` to show where the warning was created) error Error: certificate has expired at TLSSocket.onConnectSecure (node:_tls_wrap:1674:34) at TLSSocket.emit (node:events:515:28) at TLSSocket._finishInit (node:_tls_wrap:1085:8) at ssl.onhandshakedone (node:_tls_wrap:871:12) ⚠ Finalizing dependencies
错误内容如上,看着一大段,很吓人的样子,不过可以仔细阅读一下,真正的错误是在第 10 行,Error: certificate has expired,如果你去网上搜,遇到这个错误怎么办?
Electron 是一个开源的跨平台桌面应用程序开发框架,它允许开发者使用 Web 技术(如 JavaScript、HTML 和 CSS)来构建桌面应用程序。Electron 嵌入了 Chromium(一个开源的 Web 浏览器引擎)和 Node.js(一个运行在服务器端的 JavaScript 运行时环境),使得开发者能够创建既具有现代 Web 应用的丰富交互性,又具备传统桌面应用的功能和性能的应用程序。
程序员每天离不开的 Visual Studio Code,以及团队协作软件 Slack,聊天社区 Discord 的客户端,都是用 Electron 开发的,可能打出来的包会比较大,但是框架周边成熟度,兼容性和开发体验是真的很棒。仍然是现在桌面端跨平台开发的首选技术之一。最近,我就利用 Electron 技术开发了一个博客客户端软件 HexoPress,开源在 GitHub。从 0 开始学习并完整体验了 Electron 开发的各个方面。