element-ui 安装过程遇到的一些问题

1.Couldn't find preset "es2015" relative to directory

$ npm run dev

> [email protected] dev /Users/yu/workspace/bairong/cmdb_vue/app_front
> webpack-dev-server --inline --progress --config build/webpack.dev.conf.js

 94% asset optimization                                                       n
 ERROR  Failed to compile with 1 errors                                 10:09:27

 error  in ./src/main.js

Module build failed: Error: Couldn't find preset "es2015" relative to directory "/Users/yu/workspace/bairong/cmdb_vue/app_front"
    at /Users/yu/workspace/bairong/cmdb_vue/app_front/node_modules/[email protected]@babel-core/lib/transformation/file/options/option-manager.js:293:19
    at Array.map (native)
    at OptionManager.resolvePresets (/Users/yu/workspace/bairong/cmdb_vue/app_front/node_modules/[email protected]@babel-core/lib/transformation/file/options/option-manager.js:275:20)
    at OptionManager.mergePresets (/Users/yu/workspace/bairong/cmdb_vue/app_front/node_modules/[email protected]@babel-core/lib/transformation/file/options/option-manager.js:264:10)
    at OptionManager.mergeOptions (/Users/yu/workspace/bairong/cmdb_vue/app_front/node_modules/[email protected]@babel-core/lib/transformation/file/options/option-manager.js:249:14)
    at OptionManager.init (/Users/yu/workspace/bairong/cmdb_vue/app_front/node_modules/[email protected]@babel-core/lib/transformation/file/options/option-manager.js:368:12)
    at File.initOptions (/Users/yu/workspace/bairong/cmdb_vue/app_front/node_modules/[email protected]@babel-core/lib/transformation/file/index.js:212:65)
    at new File (/Users/yu/workspace/bairong/cmdb_vue/app_front/node_modules/[email protected]@babel-core/lib/transformation/file/index.js:135:24)
    at Pipeline.transform (/Users/yu/workspace/bairong/cmdb_vue/app_front/node_modules/[email protected]@babel-core/lib/transformation/pipeline.js:46:16)
    at transpile (/Users/yu/workspace/bairong/cmdb_vue/app_front/node_modules/[email protected]@babel-loader/lib/index.js:50:20)
    at Object.module.exports (/Users/yu/workspace/bairong/cmdb_vue/app_front/node_modules/[email protected]@babel-loader/lib/index.js:175:20)

 @ multi ./node_modules/[email protected]@webpack-dev-server/client?http://localhost:8080 webpack/hot/dev-server ./src/main.js

解决办法:

cnpm install babel-preset-es2015

2.eslint.org/docs/rules/no-multiple-empty-lines

Errors:
  1  http://eslint.org/docs/rules/no-multiple-empty-lines

You may use special comments to disable some warnings.
Use // eslint-disable-next-line to ignore the next line.
Use /* eslint-disable */ to ignore all warnings in a file.
//eslint.org/docs/rules/no-multiple-empty-lines

问题描述:代码行之间不允许出现多个空行
解决办法:

  • 检查代码是否有多个空行,行与行之间最多可保留一个空行
  • 初始化项目的时候在Use ESLint to lint your code 时候选择no

你可能感兴趣的:(element-ui 安装过程遇到的一些问题)