create-component-lib
create-component-lib copied to clipboard
Build failed because `babel-cli` is incompatible with current react version
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 (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
Build Output After
I was experiencing the same problem, thank you for providing a fix 👍
I was experiencing the same problem, thank you for providing a fix 👍
You're welcome
Thank you very much. It's work.
Thank you, Is this repositories still maintained? I see that the author did not agree with pr
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