0

运行 nx migrate 后,我们的 Storybook 故事正在构建,但出现以下错误:

Error: Cannot find module '@angular-devkit/build-angular/src/angular-cli-files/models/webpack-configs'
ERR!     at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
ERR!     at Function.Module._load (internal/modules/cjs/loader.js:562:25)
ERR!     at Module.require (internal/modules/cjs/loader.js:692:17)
........

我已经尝试过 npm install @angular-devkit/build-angular 但仍然出现错误。

这是 nx 版本的输出:

Angular CLI: 11.0.7
Node: 10.20.1
OS: darwin x64

Angular: 11.2.1
... animations, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router, service-worker
Ivy Workspace: <error>

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1100.7
@angular-devkit/build-angular   0.1100.7
@angular-devkit/core            11.0.7
@angular-devkit/schematics      11.0.7
@angular/cdk                    10.2.2
@angular/cli                    11.0.7
@angular/material               10.2.2
@angular/platform-server        10.1.2
@angular/youtube-player         10.0.1
@schematics/angular             11.0.7
@schematics/update              0.1100.7
rxjs                            6.6.3
typescript                      4.0.7

4

1 回答 1

0

所以这不是答案,但可能会帮助某人解决这个问题。我找到了一篇相关文章 https://github.com/storybookjs/storybook/issues/13093

基本上我编辑了这个文件:

storybook/app/angular/src/server/angular-cli_utils.ts

搜索此字符串:

'@angular-devkit/build-angular/src/angular-cli-files/models/webpack-configs'

并将其替换为:

'@angular-devkit/build-angular/src/webpack/configs'

这让我的故事可以再次构建。最后。这只是一个临时黑客。

有人有更好的解决方案吗?

于 2021-02-19T01:22:31.260 回答