错误:未知选项:.babelConfig。运行故事书时出现错误

发布于 2025-01-19 22:54:01 字数 3154 浏览 3 评论 0原文

时获取控制台错误

Error: Unknown option: .babelConfig. Check out https://babeljs.io/docs/en/babel-core/#options for more information about options.
    at throwUnknownError (:9001/Users/yashisongara/Documents/Projects/sfly-shared-library-web/node_modules/@babel/core/lib/config/validation/options.js:133:27)
    at :9001/Users/yashisongara/Documents/Projects/sfly-shared-library-web/node_modules/@babel/core/lib/config/validation/options.js:118:5
    at Array.forEach (<anonymous>)
    at validateNested (:9001/Users/yashisongara/Documents/Projects/sfly-shared-library-web/node_modules/@babel/core/lib/config/validation/options.js:94:21)
    at validate (:9001/Users/yashisongara/Documents/Projects/sfly-shared-library-web/node_modules/@babel/core/lib/config/validation/options.js:85:10)
    at loadPrivatePartialConfig (:9001/Users/yashisongara/Documents/Projects/sfly-shared-library-web/node_modules/@babel/core/lib/config/partial.js:80:50)
    at loadPrivatePartialConfig.next (<anonymous>)
    at :9001/Users/yashisongara/Documents/Projects/sfly-shared-library-web/node_modules/@babel/core/lib/config/partial.js:149:25
    at Generator.next (<anonymous>)
    at step (:9001/Users/yashisongara/Documents/Projects/sfly-shared-library-web/node_modules/gensync/index.js:261:32)
    at evaluateAsync (:9001/Users/yashisongara/Documents/Projects/sfly-shared-library-web/node_modules/gensync/index.js:291:5)
    at :9001/Users/yashisongara/Documents/Projects/sfly-shared-library-web/node_modules/gensync/index.js:93:9
    at new Promise (<anonymous>)
    at async (:9001/Users/yashisongara/Documents/Projects/sfly-shared-library-web/node_modules/gensync/index.js:92:14)
    at Object.<anonymous> (:9001/Users/yashisongara/Documents/Projects/sfly-shared-library-web/node_modules/babel-loader/lib/index.js:155:26)
    at Generator.next (<anonymous>)
    at Object../storybook-init-framework-entry.js (fesm2015 lazy namespace object:13:1)
    at __webpack_require__ (bootstrap:853:1)
    at fn (bootstrap:150:1)
    at Object.0 (fesm2015 lazy namespace object:13:1)
    at __webpack_require__ (bootstrap:853:1)
    at checkDeferredModules (bootstrap:45:1)
    at Array.webpackJsonpCallback [as push] (bootstrap:32:1)
    at main.iframe.bundle.js:1:57

在运行Storybook软件包

 "@angular-devkit/build-angular": "~0.901.15",
    "@angular-devkit/build-ng-packagr": "~0.901.15",
    "@angular/cli": "~9.1.15",
    "@angular/compiler-cli": "~9.1.13",
    "@angular/language-service": "~9.1.13",
    "@babel/core": "^7.17.8",
    "@babel/preset-react": "^7.16.7",
    "babel-loader": "^8.0.0",
    "@storybook/addon-a11y": "^6.1.9",
    "@storybook/addon-actions": "^6.1.9",
    "@storybook/addon-knobs": "^5.3.21",
    "@storybook/addon-notes": "^5.3.21",
    "@storybook/addon-viewport": "^6.1.9",
    "@storybook/angular": "^6.1.9",

。JSONBABEL.CONFIG.JS

module.exports = {
    presets:[
    "@babel/preset-env",
    "@babel/preset-angular"
  ],
}

是否有任何版本的兼容性问题,还是我缺少配置中的某些内容?尝试了几对FO解决方案

  • 删除节点模块并重新安装
  • 创建.babelrc文件

Getting console Errors while running storybook

Error: Unknown option: .babelConfig. Check out https://babeljs.io/docs/en/babel-core/#options for more information about options.
    at throwUnknownError (:9001/Users/yashisongara/Documents/Projects/sfly-shared-library-web/node_modules/@babel/core/lib/config/validation/options.js:133:27)
    at :9001/Users/yashisongara/Documents/Projects/sfly-shared-library-web/node_modules/@babel/core/lib/config/validation/options.js:118:5
    at Array.forEach (<anonymous>)
    at validateNested (:9001/Users/yashisongara/Documents/Projects/sfly-shared-library-web/node_modules/@babel/core/lib/config/validation/options.js:94:21)
    at validate (:9001/Users/yashisongara/Documents/Projects/sfly-shared-library-web/node_modules/@babel/core/lib/config/validation/options.js:85:10)
    at loadPrivatePartialConfig (:9001/Users/yashisongara/Documents/Projects/sfly-shared-library-web/node_modules/@babel/core/lib/config/partial.js:80:50)
    at loadPrivatePartialConfig.next (<anonymous>)
    at :9001/Users/yashisongara/Documents/Projects/sfly-shared-library-web/node_modules/@babel/core/lib/config/partial.js:149:25
    at Generator.next (<anonymous>)
    at step (:9001/Users/yashisongara/Documents/Projects/sfly-shared-library-web/node_modules/gensync/index.js:261:32)
    at evaluateAsync (:9001/Users/yashisongara/Documents/Projects/sfly-shared-library-web/node_modules/gensync/index.js:291:5)
    at :9001/Users/yashisongara/Documents/Projects/sfly-shared-library-web/node_modules/gensync/index.js:93:9
    at new Promise (<anonymous>)
    at async (:9001/Users/yashisongara/Documents/Projects/sfly-shared-library-web/node_modules/gensync/index.js:92:14)
    at Object.<anonymous> (:9001/Users/yashisongara/Documents/Projects/sfly-shared-library-web/node_modules/babel-loader/lib/index.js:155:26)
    at Generator.next (<anonymous>)
    at Object../storybook-init-framework-entry.js (fesm2015 lazy namespace object:13:1)
    at __webpack_require__ (bootstrap:853:1)
    at fn (bootstrap:150:1)
    at Object.0 (fesm2015 lazy namespace object:13:1)
    at __webpack_require__ (bootstrap:853:1)
    at checkDeferredModules (bootstrap:45:1)
    at Array.webpackJsonpCallback [as push] (bootstrap:32:1)
    at main.iframe.bundle.js:1:57

package.json

 "@angular-devkit/build-angular": "~0.901.15",
    "@angular-devkit/build-ng-packagr": "~0.901.15",
    "@angular/cli": "~9.1.15",
    "@angular/compiler-cli": "~9.1.13",
    "@angular/language-service": "~9.1.13",
    "@babel/core": "^7.17.8",
    "@babel/preset-react": "^7.16.7",
    "babel-loader": "^8.0.0",
    "@storybook/addon-a11y": "^6.1.9",
    "@storybook/addon-actions": "^6.1.9",
    "@storybook/addon-knobs": "^5.3.21",
    "@storybook/addon-notes": "^5.3.21",
    "@storybook/addon-viewport": "^6.1.9",
    "@storybook/angular": "^6.1.9",

babel.config.js

module.exports = {
    presets:[
    "@babel/preset-env",
    "@babel/preset-angular"
  ],
}

Is there any version compatibility issue or am I missing something in configuration ? Have tried couple fo solutions

  • removing node modules and re installing
  • creating .babelrc file

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文