我有一个Laravel项目,它可以在macOS上完美运行,我想在Ubuntu 20.04上运行。
当我运行:
npm run dev
我得到以下错误:
> @development /home/my-user/workspace/my-project
> npm run development
> @development /home/my-user/workspace/my-project
> mix
/home/my-user/workspace/my-project/node_modules/laravel-mix/bin/cli.js:39
executeScript('watch', { ...program.opts(), ...opts }, cmd.args)
^^^
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 Function.Module.runMain (module.js:605:10)
at startup (bootstrap_node.js:158:16)
at bootstrap_node.js:575:3
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @ development: `mix`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @ development 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! /home/my-user/.npm/_logs/2022-04-19T09_37_49_114Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @ dev: `npm run development`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @ dev 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! /home/my-user/.npm/_logs/2022-04-19T09_37_49_120Z-debug.log
代码版本:
npm 5.0.0
nvm 0.39.1
node 8.0.0
您的节点版本不支持展开操作符。使用8.3或更高版本