create-component-lib icon indicating copy to clipboard operation
create-component-lib copied to clipboard

Build failed because `babel-cli` is incompatible with current react version

Open alechp opened this issue 6 years ago • 5 comments

Error

ReferenceError: [BABEL] src/lib/TextInput.js: Unknown option > [email protected] build /Users/alechp/Code/alechp/.repositories/sandbox/cra-lib/sample-lib > rm -rf dist && NODE_ENV=production babel src/lib --out-dir dist --copy-files --ignore __tests__,spec.js,test.js,__snapshots__

ReferenceError: [BABEL] src/lib/TextInput.js: Unknown option: /Users/alechp/Code/alechp/.repositories/sandbox/cra-lib/sample-lib/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: "/Users/alechp/Code/alechp/.repositories/sandbox/cra-lib/sample-lib/node_modules/babel-preset-react-app/index.js") at Logger.error (/Users/alechp/Code/alechp/.repositories/sandbox/cra-lib/sample-lib/node_modules/babel-core/lib/transformation/file/logger.js:41:11) at OptionManager.mergeOptions (/Users/alechp/Code/alechp/.repositories/sandbox/cra-lib/sample-lib/node_modules/babel-core/lib/transformation/file/options/option-manager.js:226:20) at /Users/alechp/Code/alechp/.repositories/sandbox/cra-lib/sample-lib/node_modules/babel-core/lib/transformation/file/options/option-manager.js:265:14 at /Users/alechp/Code/alechp/.repositories/sandbox/cra-lib/sample-lib/node_modules/babel-core/lib/transformation/file/options/option-manager.js:323:22 at Array.map () at OptionManager.resolvePresets (/Users/alechp/Code/alechp/.repositories/sandbox/cra-lib/sample-lib/node_modules/babel-core/lib/transformation/file/options/option-manager.js:275:20) at OptionManager.mergePresets (/Users/alechp/Code/alechp/.repositories/sandbox/cra-lib/sample-lib/node_modules/babel-core/lib/transformation/file/options/option-manager.js:264:10) at OptionManager.mergeOptions (/Users/alechp/Code/alechp/.repositories/sandbox/cra-lib/sample-lib/node_modules/babel-core/lib/transformation/file/options/option-manager.js:249:14) at OptionManager.init (/Users/alechp/Code/alechp/.repositories/sandbox/cra-lib/sample-lib/node_modules/babel-core/lib/transformation/file/options/option-manager.js:368:12) at File.initOptions (/Users/alechp/Code/alechp/.repositories/sandbox/cra-lib/sample-lib/node_modules/babel-core/lib/transformation/file/index.js:212:65) npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! [email protected] build: rm -rf dist && NODE_ENV=production babel src/lib --out-dir dist --copy-files --ignore __tests__,spec.js,test.js,__snapshots__ npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the [email protected] build script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in: npm ERR! /Users/alechp/.npm/_logs/2019-09-10T21_21_32_753Z-debug.log

Fix

yarn remove babel-cli && yarn add @babel/cli

Build Output Before

Screen Shot 2019-09-10 at 2 23 26 PM

Build Output After

Screen Shot 2019-09-10 at 2 26 39 PM

alechp avatar Sep 10 '19 21:09 alechp

I was experiencing the same problem, thank you for providing a fix 👍

sarawallebo avatar Sep 12 '19 08:09 sarawallebo

I was experiencing the same problem, thank you for providing a fix 👍

You're welcome

alechp avatar Sep 15 '19 19:09 alechp

Thank you very much. It's work.

bank8426 avatar Jun 02 '20 07:06 bank8426

Thank you, Is this repositories still maintained? I see that the author did not agree with pr

FontEndArt avatar Nov 18 '20 08:11 FontEndArt

Thank you, Is this repositories still maintained? I see that the author did not agree with pr

I don't think so. Someone submitted a PR (https://github.com/aakashns/create-component-lib/pull/8) within a week of me creating this issue. That was over a year ago

alechp avatar Nov 20 '20 19:11 alechp