-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Closed as not planned
Closed as not planned
Copy link
Labels
Description
When running npm run dev
in windows 11 powershell without admin priveldges , it shows the following error
vite version 5.0.8
I have tried the same thing with git bash and cmd.
> part1@0.0.0 dev
> vite --base "./"
✘ [ERROR] Cannot read directory "../../..": Access is denied.
✘ [ERROR] Could not resolve "C:\\Users\\Harsh\\Desktop\\website\\website\\vite.config.js"
failed to load config from C:\Users\Harsh\Desktop\website\website\vite.config.js
error when starting dev server:
Error: Build failed with 2 errors:
error: Cannot read directory "../../..": Access is denied.
error: Could not resolve "C:\\Users\\Harsh\\Desktop\\website\\website\\vite.config.js"
at failureErrorWithLog (C:\Users\Harsh\Desktop\website\website\node_modules\esbuild\lib\main.js:1651:15)
at C:\Users\Harsh\Desktop\website\website\node_modules\esbuild\lib\main.js:1059:25
at runOnEndCallbacks (C:\Users\Harsh\Desktop\website\website\node_modules\esbuild\lib\main.js:1486:45)
at buildResponseToResult (C:\Users\Harsh\Desktop\website\website\node_modules\esbuild\lib\main.js:1057:7)
at C:\Users\Harsh\Desktop\website\website\node_modules\esbuild\lib\main.js:1086:16
at responseCallbacks.<computed> (C:\Users\Harsh\Desktop\website\website\node_modules\esbuild\lib\main.js:704:9)
at handleIncomingPacket (C:\Users\Harsh\Desktop\website\website\node_modules\esbuild\lib\main.js:764:9)
at Socket.readFromStdout (C:\Users\Harsh\Desktop\website\website\node_modules\esbuild\lib\main.js:680:7)
at Socket.emit (node:events:519:28)
at addChunk (node:internal/streams/readable:559:12)
note that i added --base "./"
to make it the root directory , even before it didnt work.
here's my vite.config.js
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
export default defineConfig({
plugins: [react()],
base: '/',
});
Also npm run dev
works if i give it admin priveldges or if i use older versions of vite like 2.5
Something similar in #2261 but didnt help