鍍金池/ 問答/Linux  HTML/ pm2部署Unexpected token ...報錯

pm2部署Unexpected token ...報錯

pm2部署時報錯,已經(jīng)引用了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
回答
編輯回答
逗婦乳

報錯是 {...this.options.render.csp.policies}不支持,也就是不支持object spread語法,可能你的node版本過低?

2017年12月25日 20:15