无法使用 Angular 启动 Storybook
Unable to start Storybook with Angular
我有一个计划启用故事书的现有项目。
我所做的是:
npx -p @storybook/cli sb init --type angular
当我启动项目时,我看到这些错误:
ERROR in .../src/stories/0-Welcome.stories.ts
ERROR in .../src/stories/0-Welcome.stories.ts(1,25):
TS2307: Cannot find module '@storybook/angular/demo'.
但是模块在那里,代码建议工作正常。
我的Package.json
"@storybook/addon-actions": "^5.3.17",
"@storybook/addon-links": "^5.3.17",
"@storybook/addon-notes": "^5.3.17",
"@storybook/addons": "^5.3.17",
"@storybook/angular": "^5.3.17",
"sass-loader": "^7.1.0",
"@angular/animations": "~8.2.5",
"@angular/common": "~8.2.5",
"@angular/compiler": "~8.2.5",
"@angular/core": "~8.2.5",
"@angular/forms": "~8.2.5",
"@angular/platform-browser": "~8.2.5",
"@angular/platform-browser-dynamic": "~8.2.5",
"@angular/platform-server": "~8.2.5",
"@angular/router": "~8.2.5",
"@angular/service-worker": "~8.2.5",
根据 goole 的说法,没有类似的问题 :) 有什么想法吗?
只需在 "typings.d.ts" 中添加可在 .storybook 目录中找到的以下行
declare module '@storybook/angular/demo'
我有一个计划启用故事书的现有项目。
我所做的是:
npx -p @storybook/cli sb init --type angular
当我启动项目时,我看到这些错误:
ERROR in .../src/stories/0-Welcome.stories.ts
ERROR in .../src/stories/0-Welcome.stories.ts(1,25):
TS2307: Cannot find module '@storybook/angular/demo'.
但是模块在那里,代码建议工作正常。
我的Package.json
"@storybook/addon-actions": "^5.3.17",
"@storybook/addon-links": "^5.3.17",
"@storybook/addon-notes": "^5.3.17",
"@storybook/addons": "^5.3.17",
"@storybook/angular": "^5.3.17",
"sass-loader": "^7.1.0",
"@angular/animations": "~8.2.5",
"@angular/common": "~8.2.5",
"@angular/compiler": "~8.2.5",
"@angular/core": "~8.2.5",
"@angular/forms": "~8.2.5",
"@angular/platform-browser": "~8.2.5",
"@angular/platform-browser-dynamic": "~8.2.5",
"@angular/platform-server": "~8.2.5",
"@angular/router": "~8.2.5",
"@angular/service-worker": "~8.2.5",
根据 goole 的说法,没有类似的问题 :) 有什么想法吗?
只需在 "typings.d.ts" 中添加可在 .storybook 目录中找到的以下行
declare module '@storybook/angular/demo'