在我将Angular 从12升级到14后,我在启动故事书应用程序时遇到了问题。运行时出现了一些问题:
WARN Failed to load preset: "C:\\Users\\a.shakirov\\project\\src\\front\\project-ui-kit\\node_modules\\@storybook\\angular\\dist\\ts3.9\\server\\framework-preset-angular-ivy.js"
ERR! Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: C:\Users\a.shakirov\project\src\front\project-ui-kit\node_modules\@angular\compiler-cli\bundles\ngcc\index.js
ERR! require() of ES modules is not supported.
ERR! require() of C:\Users\a.shakirov\project\src\front\project-ui-kit\node_modules\@angular\compiler-cli\bundles\ngcc\index.js from C:\Users\a.shakirov\project\src\front\project-ui-kit\node_modules\@storybook\angula
r\dist\ts3.9\server\framework-preset-angular-ivy.js is an ES module file as it is a .js file whose nearest parent package.json contains "type": "module" which defines all .js files in that package scope as ES modules.
ERR! Instead rename index.js to end in .cjs, change the requiring code to use import(), or remove "type": "module" from C:\Users\a.shakirov\project\src\front\project-ui-kit\node_modules\@angular\compiler-cli\package.json.
以及
ERR! => Could not get angular cli webpack config
ERR! Error: Missing required options in project target. Check "tsConfig, assets,
optimization"
ERR! at C:\Users\a.shakirov\project\src\front\project-ui-kit\node_modules\@storybook\angular\dist\ts3.9\server\angular-devkit-build-webpack.js:133:27
我不知道怎么修理它们
故事书版本为6.3.12
节点版本为14.17.6
Angular 版本为14
1条答案
按热度按时间qacovj5a1#
似乎只有故事书版本
7.0.0-alpha.0
才支持Angular14,所以您可能希望在项目中使用测试版本,直到实际的7+版本发布为止