Skip to content
This repository was archived by the owner on Nov 15, 2024. It is now read-only.
This repository was archived by the owner on Nov 15, 2024. It is now read-only.

npm run build does not work out of the box #3

@aldeka

Description

@aldeka

If I create a test app with npx create-component-lib myproj, then attempt to run npm run build without making any changes to the code generated by create-component-lib / create-react-app, I get this error:

$ npm run build
npm ERR! path /Users/ktolva/Code/package.json
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall open
npm ERR! enoent ENOENT: no such file or directory, open '/Users/ktolva/Code/package.json'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/ktolva/.npm/_logs/2019-01-24T21_22_02_797Z-debug.log
agaetis:Code ktolva$ cd testproj
agaetis:testproj ktolva$ npm run build

> testproj@0.1.0 build /Users/ktolva/Code/testproj
> rimraf 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/ktolva/Code/testproj/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/ktolva/Code/testproj/node_modules/babel-preset-react-app/index.js")
    at Logger.error (/Users/ktolva/Code/testproj/node_modules/babel-core/lib/transformation/file/logger.js:41:11)
    at OptionManager.mergeOptions (/Users/ktolva/Code/testproj/node_modules/babel-core/lib/transformation/file/options/option-manager.js:226:20)
    at /Users/ktolva/Code/testproj/node_modules/babel-core/lib/transformation/file/options/option-manager.js:265:14
    at /Users/ktolva/Code/testproj/node_modules/babel-core/lib/transformation/file/options/option-manager.js:323:22
    at Array.map (<anonymous>)
    at OptionManager.resolvePresets (/Users/ktolva/Code/testproj/node_modules/babel-core/lib/transformation/file/options/option-manager.js:275:20)
    at OptionManager.mergePresets (/Users/ktolva/Code/testproj/node_modules/babel-core/lib/transformation/file/options/option-manager.js:264:10)
    at OptionManager.mergeOptions (/Users/ktolva/Code/testproj/node_modules/babel-core/lib/transformation/file/options/option-manager.js:249:14)
    at OptionManager.init (/Users/ktolva/Code/testproj/node_modules/babel-core/lib/transformation/file/options/option-manager.js:368:12)
    at File.initOptions (/Users/ktolva/Code/testproj/node_modules/babel-core/lib/transformation/file/index.js:212:65)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! testproj@0.1.0 build: `rimraf 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 testproj@0.1.0 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/ktolva/.npm/_logs/2019-01-24T21_22_12_648Z-debug.log

If I look at the .babelrc file that was generated by create-component-lib, it consists of { "presets": [["react-app", { "absoluteRuntime": false }]] }
This appears to be the correct formatting mentioned by the error message.

npm start does work normally. If I leave the dev server running while I run npm run build I still get the same error.

I do not know how to proceed from here.

Running on OSX 10.14. Node version v10.15.0. I can provide the package.json I have, but it hasn't been edited at all.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions