Error building Modern PWA

It looks like SAB thinks it successfully built the PWA for Selaru. But a careful look at the summary text has this line:

Moving PWA to preview folder…
C:\Users\xyz\AppData\Local\Temp\App Builder\preview\APPBUI~1\NODE_M~1\vite\NODE_M~1@esbuild\WIN32-~1\esbuild.exe - Access is denied.
A subdirectory or file C:\Users\xyz\AppData\Local\Temp\App Builder\preview already exists.
Access is denied.

Which than gives this error in the Preview Web Server window:
npm ERR! code ENOENT
npm ERR! syscall open
npm ERR! path C:\Users\xyz\AppData\Local\Temp\App Builder\preview\appbuilder-pwa\package.json
npm ERR! errno -4058
npm ERR! enoent Could not read package.json: Error: ENOENT: no such file or directory, open ‘C:\Users\xyz\AppData\Local\Temp\App Builder\preview\appbuilder-pwa\package.json’
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent

npm ERR! A complete log of this run can be found in: C:\Users\xyz\AppData\Local\npm-cache_logs\2024-07-08T20_47_53_502Z-debug-0.log

C:\Users\xyz\AppData\Local\Temp\App Builder\preview\appbuilder-pwa>

Odd about the “Access Denied”. Any clues?

I wonder if the process is trying to delete a folder and isn’t able to. Have you manually deleted this folder and then tried doing it again?

Did you still have a terminal running a previous run of the PWA? If so, it still has the directory open and it can’t be deleted for the next run. Make sure to close the terminal started by “Run PWA” when done.

Chris

I suspect that was my problem, but the terminal window was hidden. Thanks.

I have the same problem when pressing the “Run PWA” button. The json file can’t be found.
No other instance of the web server running. Delete the SAB temp file before pressing again as per above.

I have tried this for other apps with the same (non)results.

This is the output in the Preview Web Service window:

npm ERR! code ENOENT
npm ERR! syscall open
npm ERR! path C:\Users\rnlwe\AppData\Local\Temp\App Builder\build\SAB.014\p\package.json
npm ERR! errno -4058
npm ERR! enoent Could not read package.json: Error: ENOENT: no such file or directory, open ‘C:\Users\rnlwe\AppData\Local\Temp\App Builder\build\SAB.014\p\package.json’
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent

npm ERR! A complete log of this run can be found in: C:\Users\rnlwe\AppData\Local\npm-cache_logs\2024-08-10T02_59_10_151Z-debug-0.log

What timezone are you in? I could try to meet with you to see what is going on. I am in Eastern Daylight Time (UTC-4).

Chris