当gulp-babel
我的 gulp 文件中需要es6
在我的 js 文件中使用语法时,出现错误。
/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 版本。(Node 4 来自 2016 年,在 JavaScript 术语中是相对永恒的。)
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句