我在我的 Angular 项目中安装了 Storybook,一切正常,直到今天,当我运行时,yarn install这个 Storybook 构建失败并出现以下 TS 错误
node_modules/@storybook/api/dist/ts3.9/modules/shortcuts.d.ts:55:18 - 错误 TS2430:接口“Event”错误地扩展了接口“KeyboardEvent”。呃!属性“目标”的类型不兼容。呃!类型 '{ tagName: string; 中缺少属性 'prototype' addEventListener(): 无效; 删除事件监听器():布尔值;调度事件(事件:事件):布尔值;getAttribute(attr: string): 字符串 | 无效的; }',但在“EventTarget”类型中是必需的。呃!呃!55 导出接口Event extends KeyboardEvent { 错误!~~~~~ 错误!呃!node_modules/typescript/lib/lib.dom.d.ts:5144:5 错误!第5144章 原型:EventTarget;呃!~~~~~~~~~ 错误!“原型”在这里声明。块引用
包.json
"name": "tour",
"version": "0.0.0",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"watch": "ng build --watch --configuration development",
"test": "ng test",
"docs:json": "compodoc -p ./tsconfig.json -e json -d .",
"storybook": "npm run docs:json && start-storybook -p 6006",
"build-storybook": "npm run …Run Code Online (Sandbox Code Playgroud)