pm2部署Unexpected token ...报错
pm2部署时报错,已经引用了babel插件,但还是报es6的错误,求大神指教,万分感谢!!
const policies = this.options.render.csp.policies ? {...this.options.render.csp.policies} : null
^^^
SyntaxError: Unexpected token ...
at createScript (vm.js:74:10)
at Object.runInThisContext (vm.js:116:10)
at Module._compile (module.js:533:28)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:503:32)
at tryModuleLoad (module.js:466:12)
at Function.Module._load (module.js:458:3)
at Module.require (module.js:513:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (/www/baotuan/nuxt/source/node_modules/nuxt/lib/core/renderer.js:19:24)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! nuxt@1.1.0 build: `nuxt build && backpack build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the nuxt@1.1.0 build 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! /root/.npm/_logs/2018-06-23T09_16_41_689Z-debug.log
post-deploy hook failed
Deploy failed
node -v 9.6.1
npm -v 5.6.0
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
报错是
{...this.options.render.csp.policies}
不支持,也就是不支持object spread语法,可能你的node版本过低?我这边升级node到12.x版本,这个问题就解决了。