Hey folks I hope that you are doing well. I'm facing an issue while installing Jetstream in a new Laravel project. I runned the commands perfectly but when I run almost the final commande which is npm run dev the problem below appears.
/opt/lampp/htdocs/testapp/node_modules/vite/bin/vite.js:2import { performance } from 'node:perf_hooks' ^
SyntaxError: Unexpected token { at Module._compile (internal/modules/cjs/loader.js:723:23) at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10) at Module.load (internal/modules/cjs/loader.js:653:32)at tryModuleLoad (internal/modules/cjs/loader.js:593:12)at Function.Module._load (internal/modules/cjs/loader.js:585:3)at Function.Module.runMain (internal/modules/cjs/loader.js:831:12)at startup (internal/bootstrap/node.js:283:19)at bootstrapNodeJSCore (internal/bootstrap/node.js:623:3)npm ERR! code ELIFECYCLEnpm ERR! errno 1npm ERR! @ dev: vite``
npm ERR! Exit status 1npm 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/nabeel/.npm/_logs/2023-02-22T16_28_53_790Z-debug.log
My Node version is v10.19.0
Please help me to solve this problem. Thank you all
It looks like you are running into an issue with the Vite package. It appears that the version of Node you are running is not compatible with the version of Vite you are using.
You can try updating your version of Node to the latest version (v14.15.1 as of this writing) and then running npm install again. This should install the latest version of Vite that is compatible with your version of Node.
If that doesn't work, you can try manually installing the version of Vite that is compatible with your version of Node. To do this, run the following command:
This should install the version of Vite that is compatible with your version of Node. After that, try running npm run dev again and see if that resolves the issue.