npm run dev not working with vite laravel 9

Viewed 4950
users-iMac-2:backend NEHAL$ npm run dev

> dev
> vite

file:///Users/user/Desktop/backend/node_modules/vite/bin/vite.js:7
    await import('source-map-support').then((r) => r.default.install())
    ^^^^^

SyntaxError: Unexpected reserved word
    at Loader.moduleStrategy (internal/modules/esm/translators.js:122:18)
    at async link (internal/modules/esm/module_job.js:42:21)
users-iMac-2:backend NEHAL$ 
3 Answers

Same problem. Updated node to v16.16.0 and it worked.

I had the same problem; the installed version of NodeJS on your OS is incompatible with vite; mine was v12.22.9; upgrade yours.

If you're using a debian-based OS, run the following.

curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash -
sudo apt-get install -y nodejs

Primarily, you try installing Node.js like v16/v18. you got rid of the error message on Ubuntu.

Err:10 https://ppa.launchpadcontent.net/certbot/certbot/ubuntu jammy Release
  404  Not Found [IP: 2620:2d:4000:1::3e 443]
Reading package lists... Done
W: https://repos.insights.digitalocean.com/apt/do-agent/dists/main/InRelease: Key is , see the DEPRECATION section in apt-key(8) for details.
E: The repository 'https://ppa.launchpadcontent.net/certbot/certbot/ubuntu jammy Rele
N: Updating from such a repository can't be done securely, and is therefore disabled 
N: See apt-secure(8) manpage for repository creation and user configuration details.
Error executing command, exiting

Used these commands to solve the ERROR :

sudo apt-add-repository -r ppa:certbot/certbot

After that, the following commands do not generate any errors:

sudo apt update
sudo apt-get update

Then install Nodejs from the Official github repo

and make Vuejs build from npx vite build for Npm build from npm run build.

Related