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

nabilkrs's avatar

Vite issue while installing Jetstream

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:2 import { 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 ELIFECYCLE npm ERR! errno 1 npm ERR! @ dev: vite`` 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/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

0 likes
2 replies
LaryAI's avatar
LaryAI
AI
Best Answer
Level 58

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:

npm install [email protected]

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.

1 like
nabilkrs's avatar

@LaryAI Upgrading the version of Node worked for me. Thank you for your help I appreciated.

Please or to participate in this conversation.