vue-auto-form icon indicating copy to clipboard operation
vue-auto-form copied to clipboard

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

Open tonsV2 opened this issue 7 years ago • 1 comments

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

[email protected] 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 avatar Apr 28 '17 17:04 tonsV2

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

tonsV2 avatar Apr 28 '17 17:04 tonsV2