【问题标题】:"SyntaxError: Unexpected identifier" when runnning a Nuxt.js project运行 Nextjs 项目时出现“SyntaxError: Unexpected identifier”
【发布时间】:2018-05-16 16:45:23
【问题描述】:

我用:

  • Node.js v6.14.2

  • NPM 6.0.1

  • Ubuntu 16.04

当我尝试运行一个项目时,我得到了这个错误:

npm run dev


node_modules/nuxt/lib/core/module.js:14
  async ready() {
        ^^^^^

SyntaxError: Unexpected identifier
    at createScript (vm.js:56:10)
    at Object.runInThisContext (vm.js:97:10)
    at Module._compile (module.js:549:28)
    at Object.Module._extensions..js (module.js:586:10)
    at Module.load (module.js:494:32)
    at tryModuleLoad (module.js:453:12)
    at Function.Module._load (module.js:445:3)
    at Module.require (module.js:504:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/home/ostap/Стільниця/vue-photogram/node_modules/nuxt/lib/core/index.js:2:16)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! vue-photogram@1.0.0 dev: `nuxt`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the vue-photogram@1.0.0 dev script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/ostap/.npm/_logs/2018-05-16T16_35_55_903Z-debug.log

这背后的原因是什么以及如何解决?

【问题讨论】:

    标签: javascript vue.js vuejs2 nuxt.js


    【解决方案1】:

    我的 Node.js 版本太旧。升级解决了这个问题。

    【讨论】:

      猜你喜欢
      • 2018-12-15
      • 2019-12-07
      • 2019-10-06
      • 1970-01-01
      • 2021-06-09
      • 1970-01-01
      • 2017-10-13
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多