• Our team is looking to connect with folks who use email services provided by Plesk, or a premium service. If you'd like to be part of the discovery process and share your experiences, we invite you to complete this short screening survey. If your responses match the persona we are looking for, you'll receive a link to schedule a call at your convenience. We look forward to hearing from you!
  • We are looking for U.S.-based freelancer or agency working with SEO or WordPress for a quick 30-min interviews to gather feedback on XOVI, a successful German SEO tool we’re looking to launch in the U.S.
    If you qualify and participate, you’ll receive a $30 Amazon gift card as a thank-you. Please apply here. Thanks for helping shape a better SEO product for agencies!
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.

Issue Cannot access vite config file

kylexu22

New Pleskian
Server operating system version
Unknown
Plesk version and microupdate number
Unknown
Hi, this is my first time using web hosting and I am having problems with running my Vite reactjs app. I have Nodejs installed, and I am trying to execute `npm run build` and I am getting an error. The error is centered around the vite config file. I have set all permissions to the correct options but I am still having trouble. Any help would be appreciated, thanks.

Code:
# npm run build
Process exited with non-zero exit code '1'

> [email protected] build
> vite build --config vite.config.js


X [ERROR] Cannot read directory "../../../..": Access is denied.

X [ERROR] Could not resolve "C:\\Inetpub\\vhosts\\tatronrobotics.com\\httpdocs\\vite.config.js"

failed to load config from C:\Inetpub\vhosts\tatronrobotics.com\httpdocs\vite.config.js
error during build:
Error: Build failed with 2 errors:
error: Cannot read directory "../../../..": Access is denied.
error: Could not resolve "C:\\Inetpub\\vhosts\\tatronrobotics.com\\httpdocs\\vite.config.js"
    at failureErrorWithLog (C:\inetpub\vhosts\tatronrobotics.com\httpdocs\node_modules\esbuild\lib\main.js:1651:15)
    at C:\inetpub\vhosts\tatronrobotics.com\httpdocs\node_modules\esbuild\lib\main.js:1059:25
    at runOnEndCallbacks (C:\inetpub\vhosts\tatronrobotics.com\httpdocs\node_modules\esbuild\lib\main.js:1486:45)
    at buildResponseToResult (C:\inetpub\vhosts\tatronrobotics.com\httpdocs\node_modules\esbuild\lib\main.js:1057:7)
    at C:\inetpub\vhosts\tatronrobotics.com\httpdocs\node_modules\esbuild\lib\main.js:1086:16
    at responseCallbacks.<computed> (C:\inetpub\vhosts\tatronrobotics.com\httpdocs\node_modules\esbuild\lib\main.js:704:9)
    at handleIncomingPacket (C:\inetpub\vhosts\tatronrobotics.com\httpdocs\node_modules\esbuild\lib\main.js:764:9)
    at Socket.readFromStdout (C:\inetpub\vhosts\tatronrobotics.com\httpdocs\node_modules\esbuild\lib\main.js:680:7)
    at Socket.emit (node:events:517:28)
    at addChunk (node:internal/streams/readable:335:12)

Here is my vite config file:

Code:
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [react()],
})

Here is the structure of my files:

Screen Shot 2024-04-24 at 7.07.33 AM.png
 
Hi thanks for your response. I've checked all the permissions on the files and they seem to be correct. I was thinking, does this have to do with me not having enough permissions? I am managing the website on an added user account made by the owner of the main subscription. I deployed this website on firebase and there was no problems. So maybe this is a user permission issue?
 
You don't need more, you just need to fix the permission which involved remoting into the server itself to fix it if you cannot do it through the portal. I am not familiar with how node does things but if it's not running as the user of the site then you'll need to update your permissions accordingly for whatever service you're using for node to give it access to your site's directory.

The easiest fix is to to just assign the Everyone permission access to it but doing so is a security risk.

Again, each environment is different, so you'll need to make sure your service account used for node has the permission to the site's directory.
 

kylexu22 Were you able to resolve and verify what permission is missing? I did the same thing and I have given permissions even in the console but I don't know what permissions are missing or if the changes are being saved with said permissions.​

 
@SDGPete
I have used and reviewed a lot of information, but still without satisfactory results, the only thing I had to do to solve in the meantime what the client needed to see is to build the application and upload it to the htdocs folder while I find how to solve the problem if someone succeeds, I am also attentive to any information
 
Thanks for replying @Esteark I appreciate it. I've raised a ticket with Plesk so hopefully they'll be able to shine some light on it.

In the meantime, if you have access via remote desktop, you could always run npm run build via GIT Bash, that's what I've just had to do. It had no problems accessing the vite.config.js file.
 
Back
Top