webpack/lib/Compiler.js 中的意外标记适用:util.deprecate((...args) => {

unexpected token in webpack/lib/Compiler.js apply: util.deprecate((...args) => {

我正在尝试使用 webpack 设置简单的 node/react 项目。我遵循本教程: https://spinspire.com/article/creating-expressjs-environment-webpack-react-and-babel-configurations 在尝试 运行 服务器时配置 webpack 后出现错误:

/node_modules/webpack/lib/Compiler.js:96
                apply: util.deprecate((...args) => {
                                       ^^^

SyntaxError: Unexpected token ...
    at exports.runInThisContext (vm.js:53:16)
    at Module._compile (module.js:387:25)
    at Module._extensions..js (module.js:422:10)
    at Object.require.extensions.(anonymous function) [as .js] (/home/zaba/code/CurrencyCalc/node_modules/babel-register/lib/node.js:152:7)
    at Module.load (module.js:357:32)
    at Function.Module._load (module.js:314:12)
    at Module.require (module.js:367:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/home/zaba/code/CurrencyCalc/node_modules/webpack/lib/webpack.js:7:18)
    at Module._compile (module.js:413:34)

npm ERR! Linux 4.13.0-37-generic 
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "start" 
npm ERR! node v5.12.0 
npm ERR! npm  v3.8.6 
npm ERR! code ELIFECYCLE 
npm ERR! currencycalc@1.0.0 start: `babel-node buildScripts/server.js` 
npm ERR! Exit status 1 
npm ERR!  
npm ERR!  Failed at the currencycalc@1.0.0 start script 'babel-node buildScripts/server.js'. 
npm ERR! Make sure you have the latest version of node.js and npm installed. 
npm ERR! If you do, this is most likely a problem with the currencycalc package, 
npm ERR! not with npm itself. 
npm ERR! Tell the author that this fails on your system: 
npm ERR!     babel-node buildScripts/server.js 
npm ERR! You can get information on how to open an issue for this project with: 
npm ERR!   npm bugs currencycalc 
npm ERR! Or if that isn't available, you can get their info via: 
npm ERR!     npm owner ls currencycalc 
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /home/zaba/code/CurrencyCalc/npm-debug.log

webpack 真的有问题还是我应该在我的代码中查找错误?如果是的话在哪里? Google 不是很有用...

合并信息以防其他人运行遇到同样的问题,问题是节点版本。 Webpack 是 运行 by node,根据错误消息,节点版本是 5.12.0。错误行使用rest parameters.† Per the compatibility table,node 5.12.0不支持没有--harmony标志的rest参数。但是,如果可以管理的话,更新到更新的节点比使用标志更好 :) .

... 在参数列表中使用时是 "rest parameters",但在其他上下文中是 "spread syntax"