From 568e379534c1450661bd5f85e2897a42ba113321 Mon Sep 17 00:00:00 2001 From: beilunyang <786220806@qq.com> Date: Sun, 15 Jun 2025 11:53:18 +0800 Subject: [PATCH] refactor: update package.json import method for compatibility with nodejs 22+ --- utils/notify.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/utils/notify.js b/utils/notify.js index 84cbcfb..9cc76c5 100644 --- a/utils/notify.js +++ b/utils/notify.js @@ -1,7 +1,11 @@ import nodemailer from "nodemailer"; import axios from "axios"; import env from "./env.js"; -import pkg from "../package.json" assert { type: "json" }; +import { readFileSync } from "fs"; + +const pkg = JSON.parse( + readFileSync(new URL("../package.json", import.meta.url), "utf8") +); export class Notify { /**