Thank you for this. Was struggling to get this to work.
I also added php
to the compile commands which seem to resolve the permission errors:
"scripts": {
"compile": [
"php bin/grav install",
"php bin/gpm install admin -y",
"php bin/gpm install antimatter -y"
]
}