原来的写法,直接在最上面 import fs from 'fs-extra'; 在函数中,使用到的地方引入,修改为动态的 const fs = await import("fs-extra"); 结果成功不抱错