iview / iview-project

This project is build for Vue.js 2 + vue-router + webpack2 + iView 3
MIT License
839 stars 389 forks source link

npm run init 报错 #1

Open Racaly opened 7 years ago

Racaly commented 7 years ago

ERROR in ./src/main.js Module build failed: Error: Couldn't find preset "es2015" relative to directory "/home//project" at /home//project/iview-project/node_modules/babel-core/lib/transformation/file/options/option-manager.js:299:19 at Array.map (native) at OptionManager.resolvePresets (/home//project/iview-project/node_modules/babel-core/lib/transformation/file/options/option-manager.js:270:20) at OptionManager.mergePresets (/home//project/iview-project/node_modules/babel-core/lib/transformation/file/options/option-manager.js:259:10) at OptionManager.mergeOptions (/home//project/iview-project/node_modules/babel-core/lib/transformation/file/options/option-manager.js:244:14) at OptionManager.init (/home//project/iview-project/node_modules/babel-core/lib/transformation/file/options/option-manager.js:374:12) at File.initOptions (/home//project/iview-project/node_modules/babel-core/lib/transformation/file/index.js:216:65) at new File (/home//project/iview-project/node_modules/babel-core/lib/transformation/file/index.js:139:24) at Pipeline.transform (/home//project/iview-project/node_modules/babel-core/lib/transformation/pipeline.js:46:16) at transpile (/home//project/iview-project/node_modules/babel-loader/lib/index.js:41:20) at Object.module.exports (/home/**/project/iview-project/node_modules/babel-loader/lib/index.js:138:12)

trialbox commented 7 years ago

我在package.json 中加入 "babel": { "presets": [ "es2015" ] } 后能使用