ReferenceError:[BABEL] /home/sriram/Desktop/gooodbet/client/scripts/test.js:未知选项:/node_modules/babel-preset-react-app/index.js.overrides

时间:2019-01-16 12:23:40

标签: express jestjs babel create-react-app

使用jest运行npm test时出现以下错误。我有一个快速应用程序,其中有一个客户端文件夹,它是一个create-react-app-2,当我弹出它时,问题就出现了。现在做什么 ??

Test suite failed to run

    ReferenceError: [BABEL] /home/sriram/Desktop/gooodbet/client/scripts/test.js: Unknown option: /home/sriram/Desktop/gooodbet/client/node_modules/babel-preset-react-app/index.js.overrides. Check out http://babeljs.io/docs/usage/options/ for more information about options.

    A common cause of this error is the presence of a configuration options object without the corresponding preset name. Example:

    Invalid:
      `{ presets: [{option: value}] }`
    Valid:
      `{ presets: [['presetName', {option: value}]] }`

    For more detailed information on preset configuration, please see https://babeljs.io/docs/en/plugins#pluginpresets-options. (While processing preset: "/home/sriram/Desktop/gooodbet/client/node_modules/babel-preset-react-app/index.js")

      at Logger.error (node_modules/babel-core/lib/transformation/file/logger.js:41:11)
      at OptionManager.mergeOptions (node_modules/babel-core/lib/transformation/file/options/option-manager.js:226:20)
      at node_modules/babel-core/lib/transformation/file/options/option-manager.js:265:14
      at node_modules/babel-core/lib/transformation/file/options/option-manager.js:323:22
          at Array.map (<anonymous>)
      at OptionManager.resolvePresets (node_modules/babel-core/lib/transformation/file/options/option-manager.js:275:20)
      at OptionManager.mergePresets (node_modules/babel-core/lib/transformation/file/options/option-manager.js:264:10)
      at OptionManager.mergeOptions (node_modules/babel-core/lib/transformation/file/options/option-manager.js:249:14)
      at OptionManager.init (node_modules/babel-core/lib/transformation/file/options/option-manager.js:368:12)
      at File.initOptions (node_modules/babel-core/lib/transformation/file/index.js:212:65)


 RUNS  tests/integration/localAuth.test.js
 FAIL  tests/integration/localAuth.test.js
  localAuth
    POST /api/signup
      ✓ should signup successfully (536ms)
      ✕ should send 400 for not having email (8ms)

  ● localAuth › POST /api/signup › should send 400 for not having email

    Bad Request

      at Test.Object.<anonymous>.Request.callback (node_modules/superagent/lib/node/index.js:804:15)
      at IncomingMessage.parser (node_modules/superagent/lib/node/index.js:1036:18)

Test Suites: 2 failed, 2 total
Tests:       1 failed, 1 passed, 2 total
Snapshots:   0 total
Time:        2.378s
Ran all test suites.

1 个答案:

答案 0 :(得分:-1)

我遵循了这个link

撤消create-react-app的弹出,一切都可以正常工作