• 关于webpack,打包时遇到的错误


    最近在研究webpack这玩意,然后遇到一个问题,执行npm run build的时候,出现下面这个问题,各种搜索后,各种尝试,都没解决

    运行时报错ERROR in ./src/app.vue Module build failed: SyntaxError: Unexpected token {

    ERROR in ./src/app.vue

    Module build failed: SyntaxError: Unexpected token {

        at exports.runInThisContext (vm.js:53:16)

        at Module._compile (module.js:373:25)

        at Object.Module._extensions..js (module.js:416:10)

        at Module.load (module.js:343:32)

        at Function.Module._load (module.js:300:12)

        at Module.require (module.js:353:17)

        at require (internal/module.js:12:17)

        at Object.<anonymous> (E:somethingvue-test ode_modulesvue-loaderindex.js:1:80)

        at Module._compile (module.js:409:26)

        at Object.Module._extensions..js (module.js:416:10)

        at Module.load (module.js:343:32)

        at Function.Module._load (module.js:300:12)

        at Module.require (module.js:353:17)

        at require (internal/module.js:12:17)

        at loadLoader (E:somethingvue-test ode_moduleswebpack ode_modulesloader-runnerlibloadLoader.js:13:17)

        at iteratePitchingLoaders (E:somethingvue-test ode_moduleswebpack ode_modulesloader-runnerlibLoaderRunner.js:169:2)

        at runLoaders (E:somethingvue-test ode_moduleswebpack ode_modulesloader-runnerlibLoaderRunner.js:362:2)

        at NormalModule.doBuild (E:somethingvue-test ode_moduleswebpacklibNormalModule.js:182:3)

        at NormalModule.build (E:somethingvue-test ode_moduleswebpacklibNormalModule.js:275:15)

        at Compilation.buildModule (E:somethingvue-test ode_moduleswebpacklibCompilation.js:151:10)

        at factoryCallback (E:somethingvue-test ode_moduleswebpacklibCompilation.js:344:12)

        at E:somethingvue-test ode_moduleswebpacklibNormalModuleFactory.js:241:5

        at E:somethingvue-test ode_moduleswebpacklibNormalModuleFactory.js:94:13

        at E:somethingvue-test ode_moduleswebpack ode_modules apablelibTapable.js:268:11

        at NormalModuleFactory.<anonymous> (E:somethingvue-test ode_moduleswebpacklibCompatibilityPlugin.js:52:5)

        at NormalModuleFactory.applyPluginsAsyncWaterfall (E:somethingvue-test ode_moduleswebpack ode_modules apablelibTapable.js:272:13)

        at E:somethingvue-test ode_moduleswebpacklibNormalModuleFactory.js:69:10

        at E:somethingvue-test ode_moduleswebpacklibNormalModuleFactory.js:194:7

        at nextTickCallbackWith0Args (node.js:420:9)

        at process._tickCallback (node.js:349:13)

     @ ./src/index.js 2:0-27

    差点要放弃的时候,(当然没放弃,绝望的时候找大神啊 哈哈哈、)被大神点播了下,语法错误,可能应该是node.js的版本问题,我现在安装的nodejs不支持es6的语法,然后就重新安装了下最新的node.js,就解决了 哇哈哈哈、

    可能大神们也发现这种问题,但是不是像我这样解决的,欢迎留言分享啊 谢谢!学习在路上......

  • 相关阅读:
    redis 安装,及基本命令
    Scrapy爬取大众养生网
    笔记——抓包工具抓取手机app内容
    爬取起点小说网(三)遇到的问题和代码解析
    爬取起点小说网(二)设计代码
    爬取起点小说网(一)设计思想
    python爬取豆瓣登陆验证码
    python爬去笔趣阁完整一本小说
    把爬取到的链接放到数据库
    python爬取网络图片
  • 原文地址:https://www.cnblogs.com/qiufang/p/8532712.html
Copyright © 2020-2023  润新知