Invalid Configuration Error in Craft CMS 3 using Nitro 2
This path is on your host machine but this isn't how docker sees things. To Nitro, the location of the folder is /app/web/cpresources.
Without going into too much details, I'd recommend going with an alias instead of hard-setting your webroot the way you are currently doing it. Doing so will make your scaffolding just work without having to change this path every time.
In your config/general.php define your webroot alias like this:
'aliases' =&gt; [
    'webroot' =&gt; dirname(__DIR__) . '/web'
],

You can then remove 'resourceBasePath' =&gt; App::env('WEB_ROOT_PATH').'cpresources', altogether since its default value is already correct.
This alias will also be handy for setting things like File System Path on your volumes.