cocos creator 3.4.1 下,逻辑部分为了避免依赖 cc.Component.schedule(),想要使用 node-schedule 方便测试,
npm i node-schedule
npm i --save @types/node-schedule
下载之后,编辑器给出以下错误,
2022-04-17 21:21:38-error: Failed to load module node:events: Error: Access to module node:events is denied..
2022-04-17 21:21:38-warn: Seems like you're attempted to import a Node.js builtin module. Note, Node.js builtin modules are not integrated within Creator.
2022-04-17 21:21:38-error: Failed to load module node:fs: Error: Access to module node:fs is denied..
2022-04-17 21:21:38-warn: Seems like you're attempted to import a Node.js builtin module. Note, Node.js builtin modules are not integrated within Creator.
2022-04-17 21:21:41-error: Failed to load module node:events: Error: Access to module node:events is denied..
2022-04-17 21:21:41-warn: Seems like you're attempted to import a Node.js builtin module. Note, Node.js builtin modules are not integrated within Creator.
2022-04-17 21:21:41-error: [Scene] Failed to resolve events from pack:///mods/fs/0/node_modules/node-schedule/lib/Job.js.
2022-04-17 21:21:41-log: [Scene] csv * loading ...
2022-04-17 21:21:41-error: Failed to load module node:fs: Error: Access to module node:fs is denied..
2022-04-17 21:21:41-warn: Seems like you're attempted to import a Node.js builtin module. Note, Node.js builtin modules are not integrated within Creator.