最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

'gulp

运维笔记admin17浏览0评论

'gulp

'gulp

[在我的gulp文件中要求gulp-babel时,在我的js文件中使用es6语法时出现错误。

/home/logakrishnan/Documents/project/node_modules/@babel/core/lib/transformation/file/file.js:77
  constructor(options, {
                       ^

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> (/home/logakrishnan/Documents/project/node_modules/@babel/core/lib/index.js:153:36)
    at Module._compile (module.js:409:26)
    at Object.Module._extensions..js (module.js:416:10)

节点版本:v4.4.7

回答如下:

您将必须升级您的Node.js版本。 (节点4是从2016开始的,相对而言JavaScript而言是永恒的。)

At the time of writing, Babel requires Node 6.9 or newer.

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论