File tree 1 file changed +13
-4
lines changed 1 file changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -1857,14 +1857,23 @@ async function loadConfigFromBundledFile(
1857
1857
// Storing the bundled file in node_modules/ is avoided for Deno
1858
1858
// because Deno only supports Node.js style modules under node_modules/
1859
1859
// and configs with `npm:` import statements will fail when executed.
1860
- const nodeModulesDir =
1860
+ let nodeModulesDir =
1861
1861
typeof process . versions . deno === 'string'
1862
1862
? undefined
1863
1863
: findNearestNodeModules ( path . dirname ( fileName ) )
1864
1864
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
+ }
1868
1877
}
1869
1878
const hash = `timestamp-${ Date . now ( ) } -${ Math . random ( ) . toString ( 16 ) . slice ( 2 ) } `
1870
1879
const tempFileName = nodeModulesDir
You can’t perform that action at this time.
0 commit comments