Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

AlexSteele's avatar

can't perform run dev

issue when running npm on the command line. some housekeeping questions out of the way: i am on a fully functioning test server running centos7

node -v yields v6.17.1

I also thought i had boinked things by installing yarn incorrectly, as can sometimes happen - but I removed yarn and made sure to use yum to add it back. i also removed nodejs and npm entirely and then added npm back. I then removed the testing app i was tinkering with in laravel and then added it back. starting from scratch! running the the command npm run dev yields a very long error -

are there some commands I can use to clean out npm? does anyone know what would cause this?

the error:

@ dev /home/frog/domains/websockets.frog.aeonmedia.com/public_html/websockets npm run development

@ development /home/frog/domains/websockets.frog.aeonmedia.com/public_html/websockets mix

/home/frog/domains/websockets.frog.aeonmedia.com/public_html/websockets/node_modules/laravel-mix/bin/cli.js:12 async function run() { ^^^^^^^^

SyntaxError: Unexpected token function at createScript (vm.js:56:10) at Object.runInThisContext (vm.js:97:10) at Module._compile (module.js:549:28) at Object.Module._extensions..js (module.js:586:10) at Module.load (module.js:494:32) at tryModuleLoad (module.js:453:12) at Function.Module._load (module.js:445:3) at Module.runMain (module.js:611:10) at run (bootstrap_node.js:394:7) at startup (bootstrap_node.js:160:9)

npm ERR! Linux 3.10.0-1160.6.1.el7.x86_64 npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "run" "development" npm ERR! node v6.17.1 npm ERR! npm v3.10.10 npm ERR! code ELIFECYCLE npm ERR! @ development: mix npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the @ development script 'mix'. 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 package, npm ERR! not with npm itself. npm ERR! Tell the author that this fails on your system: npm ERR! mix npm ERR! You can get information on how to open an issue for this project with: npm ERR! npm bugs npm ERR! Or if that isn't available, you can get their info via: npm ERR! npm owner ls npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request: npm ERR! ........websockets/npm-debug.log

npm ERR! Linux 3.10.0-1160.6.1.el7.x86_64 npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "run" "dev" npm ERR! node v6.17.1 npm ERR! npm v3.10.10 npm ERR! code ELIFECYCLE npm ERR! @ dev: npm run development npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the @ dev script 'npm run development'. 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 package, npm ERR! not with npm itself. npm ERR! Tell the author that this fails on your system: npm ERR! npm run development npm ERR! You can get information on how to open an issue for this project with: npm ERR! npm bugs npm ERR! Or if that isn't available, you can get their info via: npm ERR! npm owner ls npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request: npm ERR! ......websockets/npm-debug.log

0 likes
3 replies
thinkverse's avatar
Level 15

Most likely you need to update your Node version, v6.0 is pretty old considering v14.0 is LTS and v15.0 is the current version, and looking at Mix's package.json it requires "node": ">=12.14.0", so v6.0 is unsupported.

1 like

Please or to participate in this conversation.