The other answers are probably what you want to use. FYI, here's where your errors came from.
${postid=41930}
To assign 41930 to posted, just use postid=41930. Note there are no spaces around the equals sign!
while ${postid} < 42000;
The {} around postid are optional; $postid works just as well.. You do need to wrap that conditional expansion in a command, as the while loop can't use a bare expression. Something like while [ $postid < 42000 ];. Note that in this case, you must have spaces separating the [ and ] from the rest of the expression.
do
`node title.js ${postid}`
${postid} = ${postid} +1;
In order to assign a value to a variable, bash does not allow spaces around the equal sign. With spaces, it interprets this line by expanding $postid and treating that as a command to run, with = as the first argument. Use postid=$postid + 1;. On the left, no dollar sign is needed, as you are not expanding the value of a variable, but assigning to a name. On the right, you need the dollar sign to get the value of posted.
done