
Richard C.
—You might get the error vite: Permission denied when running vite, vite build, or an npm script from your package.json file, like npm run build that ultimately calls vite. This error occurs because your user does not have permissions to access the node_modules folder.
The most common cause of this error is that you ran sudo npm install instead of npm install. In this case, your node_modules is now owned by the root user and your user does not have permission to access the folder.
The solution to this problem is to change the owner of node_modules and all its subfolders to your user. Assuming your username is me, the command to do this is:
sudo chown -R me ./node_modules
Tasty treats for web developers brought to you by Sentry. Get tips and tricks from Wes Bos and Scott Tolinski.
SEE EPISODESConsidered “not bad” by 4 million developers and more than 100,000 organizations worldwide, Sentry provides code-level observability to many of the world’s best-known companies like Disney, Peloton, Cloudflare, Eventbrite, Slack, Supercell, and Rockstar Games. Each month we process billions of exceptions from the most popular products on the internet.
