美文网首页
element-ui 安装过程遇到的一些问题

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

作者: 万色星辰 | 来源:发表于2017-12-12 10:33 被阅读0次

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

    $ npm run dev
    
    > app_front@1.0.0 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/_babel-core@6.26.0@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/_babel-core@6.26.0@babel-core/lib/transformation/file/options/option-manager.js:275:20)
        at OptionManager.mergePresets (/Users/yu/workspace/bairong/cmdb_vue/app_front/node_modules/_babel-core@6.26.0@babel-core/lib/transformation/file/options/option-manager.js:264:10)
        at OptionManager.mergeOptions (/Users/yu/workspace/bairong/cmdb_vue/app_front/node_modules/_babel-core@6.26.0@babel-core/lib/transformation/file/options/option-manager.js:249:14)
        at OptionManager.init (/Users/yu/workspace/bairong/cmdb_vue/app_front/node_modules/_babel-core@6.26.0@babel-core/lib/transformation/file/options/option-manager.js:368:12)
        at File.initOptions (/Users/yu/workspace/bairong/cmdb_vue/app_front/node_modules/_babel-core@6.26.0@babel-core/lib/transformation/file/index.js:212:65)
        at new File (/Users/yu/workspace/bairong/cmdb_vue/app_front/node_modules/_babel-core@6.26.0@babel-core/lib/transformation/file/index.js:135:24)
        at Pipeline.transform (/Users/yu/workspace/bairong/cmdb_vue/app_front/node_modules/_babel-core@6.26.0@babel-core/lib/transformation/pipeline.js:46:16)
        at transpile (/Users/yu/workspace/bairong/cmdb_vue/app_front/node_modules/_babel-loader@7.1.2@babel-loader/lib/index.js:50:20)
        at Object.module.exports (/Users/yu/workspace/bairong/cmdb_vue/app_front/node_modules/_babel-loader@7.1.2@babel-loader/lib/index.js:175:20)
    
     @ multi ./node_modules/_webpack-dev-server@2.9.7@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 安装过程遇到的一些问题

          本文链接:https://www.haomeiwen.com/subject/oyugixtx.html