wenzhixin / vue-auto-form

A vue2 component that helpers to easily create basic forms with automatic insert and update events, and automatic reactive validation.
https://wenzhixin.github.io/vue-auto-form/
MIT License
40 stars 9 forks source link

Module build failed: Error: Couldn't find preset "es2015" relative to directory... #8

Open tonsV2 opened 7 years ago

tonsV2 commented 7 years ago

If I create a new project by doing "vue init webpack vue-auto-form-error", adding vue-auto-form to packages and creating a very simple component. I get the following error.

[tons@localhost vue-auto-form-error]$ npm run dev

vue-auto-form-error@1.0.0 dev /home/tons/IdeaProjects/vue-auto-form-error node build/dev-server.js

Starting dev server...

ERROR Failed to compile with 1 errors 7:32:38 PM

error in ./~/vue-auto-form/src/AutoForm.vue

Module build failed: Error: Couldn't find preset "es2015" relative to directory "/home/tons/IdeaProjects/vue-auto-form-error/node_modules/vue-auto-form" at /home/tons/IdeaProjects/vue-auto-form-error/node_modules/babel-core/lib/transformation/file/options/option-manager.js:293:19 at Array.map (native) at OptionManager.resolvePresets (/home/tons/IdeaProjects/vue-auto-form-error/node_modules/babel-core/lib/transformation/file/options/option-manager.js:275:20) at OptionManager.mergePresets (/home/tons/IdeaProjects/vue-auto-form-error/node_modules/babel-core/lib/transformation/file/options/option-manager.js:264:10) at OptionManager.mergeOptions (/home/tons/IdeaProjects/vue-auto-form-error/node_modules/babel-core/lib/transformation/file/options/option-manager.js:249:14) at OptionManager.init (/home/tons/IdeaProjects/vue-auto-form-error/node_modules/babel-core/lib/transformation/file/options/option-manager.js:368:12) at File.initOptions (/home/tons/IdeaProjects/vue-auto-form-error/node_modules/babel-core/lib/transformation/file/index.js:212:65) at new File (/home/tons/IdeaProjects/vue-auto-form-error/node_modules/babel-core/lib/transformation/file/index.js:135:24) at Pipeline.transform (/home/tons/IdeaProjects/vue-auto-form-error/node_modules/babel-core/lib/transformation/pipeline.js:46:16) at transpile (/home/tons/IdeaProjects/vue-auto-form-error/node_modules/babel-loader/lib/index.js:46:20) at Object.module.exports (/home/tons/IdeaProjects/vue-auto-form-error/node_modules/babel-loader/lib/index.js:163:20)

@ ./~/vue-auto-form/src/AutoForm.vue 3:2-92 @ ./~/vue-auto-form/src/index.js @ ./~/babel-loader/lib!./~/vue-loader/lib/selector.js?type=script&index=0!./src/components/Hello.vue @ ./src/components/Hello.vue @ ./src/router/index.js @ ./src/main.js @ multi ./build/dev-client ./src/main.js

Listening at http://localhost:8080

I can fix the above by adding babel-preset-es2015 as a dependency to package.json of that project. But should that really be nessecary. I mean isn't this a matter of configuring vue-auto-form properly?

tonsV2 commented 7 years ago

I've created a failing sample here... https://github.com/tonsV2/vue-auto-form-error