File tree Expand file tree Collapse file tree 1 file changed +13
-4
lines changed
Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -1857,14 +1857,23 @@ async function loadConfigFromBundledFile(
18571857 // Storing the bundled file in node_modules/ is avoided for Deno
18581858 // because Deno only supports Node.js style modules under node_modules/
18591859 // and configs with `npm:` import statements will fail when executed.
1860- const nodeModulesDir =
1860+ let nodeModulesDir =
18611861 typeof process . versions . deno === 'string'
18621862 ? undefined
18631863 : findNearestNodeModules ( path . dirname ( fileName ) )
18641864 if ( nodeModulesDir ) {
1865- await fsp . mkdir ( path . resolve ( nodeModulesDir , '.vite-temp/' ) , {
1866- recursive : true ,
1867- } )
1865+ try {
1866+ await fsp . mkdir ( path . resolve ( nodeModulesDir , '.vite-temp/' ) , {
1867+ recursive : true ,
1868+ } )
1869+ } catch ( e ) {
1870+ if ( e . code === 'EACCES' ) {
1871+ // If there is no access permission, a temporary configuration file is created by default.
1872+ nodeModulesDir = undefined
1873+ } else {
1874+ throw e
1875+ }
1876+ }
18681877 }
18691878 const hash = `timestamp-${ Date . now ( ) } -${ Math . random ( ) . toString ( 16 ) . slice ( 2 ) } `
18701879 const tempFileName = nodeModulesDir
You can’t perform that action at this time.
0 commit comments