求助:@nocobase/database 编译出错

@nocobase/database: build declaration
E:/VscodeProject/nocobase/packages/core/database/lib/collection.js(1,1): error TS9006: Declaration emit for this file requires using private name ‘StaticEventEmitterOptions’ from module ‘“events”’. An explicit type annotation may unblock declaration emit.
E:/VscodeProject/nocobase/packages/core/database/lib/collection.js(1,1): error TS9006: Declaration emit for this file requires using private name ‘_DOMEventTarget’ from module ‘“events”’. An explicit type annotation may
unblock declaration emit.
E:/VscodeProject/nocobase/packages/core/database/lib/collection.js(1,1): error TS9006: Declaration emit for this file requires using private name ‘_NodeEventTarget’ from module ‘“events”’. An explicit type annotation may unblock declaration emit.
E:/VscodeProject/nocobase/packages/core/database/lib/database.js(1,1): error TS9006: Declaration emit for this file requires using private name ‘StaticEventEmitterOptions’ from module ‘“events”’. An explicit type annotation may unblock declaration emit.
E:/VscodeProject/nocobase/packages/core/database/lib/database.js(1,1): error TS9006: Declaration emit for this file requires using private name ‘_DOMEventTarget’ from module ‘“events”’. An explicit type annotation may unblock declaration emit.
E:/VscodeProject/nocobase/packages/core/database/lib/database.js(1,1): error TS9006: Declaration emit for this file requires using private name ‘_NodeEventTarget’ from module ‘“events”’. An explicit type annotation may unblock declaration emit.
E:/VscodeProject/nocobase/packages/core/database/lib/fields/relation-field.js(1,1): error TS9005: Declaration
emit for this file requires using private name ‘_RelationField.TargetModel’. An explicit type annotation may unblock declaration emit.
packages\core\database\src\mock-database.ts(11,10): error TS2305: Module ‘“…/lib”’ has no exported member ‘Database’.
packages\core\database\src\mock-database.ts(11,20): error TS2305: Module ‘“…/lib”’ has no exported member ‘IDatabaseOptions’.
packages\core\database\src\relation-repository\types.ts(10,10): error TS2305: Module ‘“…/…/lib”’ has no exported member ‘AssociationKeysToBeUpdate’.
packages\core\database\src\relation-repository\types.ts(10,37): error TS2305: Module ‘“…/…/lib”’ has no exported member ‘BlackList’.
packages\core\database\src\relation-repository\types.ts(10,48): error TS2305: Module ‘“…/…/lib”’ has no exported member ‘Values’.
packages\core\database\src\relation-repository\types.ts(10,56): error TS2305: Module ‘“…/…/lib”’ has no exported member ‘WhiteList’.
TypeScript: 6 semantic errors
TypeScript: 17 declaration errors
TypeScript: -10 emit errors
TypeScript: emit succeeded (with errors)
E:\VscodeProject\nocobase\node_modules\gulp-typescript\release\output.js:131
this.streamFull.emit(‘error’, new Error(“TypeScript: Compilation failed”));
^

Error: TypeScript: Compilation failed
at Output.mightFinish (E:\VscodeProject\nocobase\node_modules\gulp-typescript\release\output.js:131:43)
at E:\VscodeProject\nocobase\node_modules\gulp-typescript\release\output.js:66:22
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
Emitted ‘error’ event on CompileStream instance at:
at E:\VscodeProject\nocobase\node_modules\gulp-typescript\release\output.js:117:29
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

Node.js v20.14.0
E:\VscodeProject\nocobase\node_modules\execa\lib\error.js:60
error = new Error(message);
^

Error: Command failed with exit code 1: nocobase-build
at makeError (E:\VscodeProject\nocobase\node_modules\execa\lib\error.js:60:11)
at handlePromise (E:\VscodeProject\nocobase\node_modules\execa\index.js:118:26)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async Command. (E:\VscodeProject\nocobase\packages\core\cli\src\commands\build.js:40:7) {
shortMessage: 'Command failed with exit code 1: nocobase-build ',
command: 'nocobase-build ',
escapedCommand: ‘nocobase-build “” “” “” “”’,
exitCode: 1,
signal: undefined,
signalDescription: undefined,
stdout: undefined,
stderr: undefined,
failed: true,
timedOut: false,
isCanceled: false,
killed: false
}

yarn: 1.22.22
node: 20.14.0

关键是clean之后第一次yarn build ,第二次yarn build @nocobase/database就会出现这个错误。

clean ,删除node_modules,切换node版本都试了

如果你是用的 git 源码方式build 会有一些奇怪的问题,你最好以 create-nocobase-app 这个方式来build

这有点尴尬呀,那咋开发呢。

我是用 git 源码方式来开发的 然后用app这个来build。 后续官方可能会修复吧