12:36:39 AM: $ yarn build 12:36:39 AM: yarn run v1.22.4 12:36:39 AM: $ node -e require('./src/buildPosts.js').getPosts() 12:36:39 AM: /bin/sh: 1: Syntax error: "(" unexpected 12:36:39 AM: error Command failed with exit code 2.
I am attempting to run a node script during the prebuild process that will generate a json file in my src directory. It works locally however, when ran in the netlify build shell it seems to complain about
bin/sh: 1: Syntax error: "(" unexpected, when googling the error most responces relate back to bash scripting, is this command not suppose to be using “bin/sh” somehow?
I am not sure of the root cause, is it because the build is running in ubuntu and thats different to my bash terminal? Or maybe I am just using the wrong syntax for the netlify build?