• Hi, Pleskians! We are running a UX testing of our upcoming product intended for server management and monitoring.
    We would like to invite you to have a call with us and have some fun checking our prototype. The agenda is pretty simple - we bring new design and some scenarios that you need to walk through and succeed. We will be watching and taking insights for further development of the design.
    If you would like to participate, please use this link to book a meeting. We will sent the link to the clickable prototype at the meeting.
  • (Plesk for Windows):
    MySQL Connector/ODBC 3.51, 5.1, and 5.3 are no longer shipped with Plesk because they have reached end of life. MariaDB Connector/ODBC 64-bit 3.2.4 is now used instead.
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.

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