Cannot deploy to custom directory with Gatsby

Hi,
I have a similar problem to

although my situation is as follows:

root dir:
– css
– index.html
– (Gatsby files)

where Gatsby files are the standard Gatsby files from the Gatsby root directory.
I want my gatsby site to be accessible at mydomain.com/blog and my .index.html file from that root dir to remain accessible at my domain.com just as it is now.
As suggested in that Post above, I set my Netlify build command as:
gatsby build && mkdir new-public/blog && cp public/* new-public/blog
and publish directory as:
new-public/

But the build fails. It looks like it fails to create the directory. My Gatsby config doesn’t use
pathPrefix.
Btw why does Netlify install Node 8.16.2 instead of a recent release?
Thank you


2:50:59 PM: Executing user command: mkdir new-public/blog && gatsby build && cp public/* new-public/blog

2:50:59 PM: mkdir: cannot create directory ‘new-public/blog’

2:50:59 PM: : No such file or directory

2:50:59 PM: Skipping functions preparation step: no functions directory set

Ok worked around the issue but it still installs node 8…

Hello, @apple2, and welcome to our Netlify community site. My best guess about the “No such file or directory” error (and I do see that you already resolved this issue) is that the directory new-public doesn’t exist.

If so, the following build command might resolve the issue:

mkdir -p new-public/blog && gatsby build && cp public/* new-public/blog

The -p option to mkdir will do the following:

       -p, --parents
              no error if existing, make parent directories as needed

Regarding the node version being used, you can set that using an environment variable named NODE_VERSION on the site configuration. There is more documentation about these types of environment variables here:

If there are other questions, please let us know.