It's a here-string, not all shells use this syntax, but at least bash, ksh, zsh
Check :
man bash | less +/'Here Strings'
:
A variant of here documents, the format is:
[n]<<
The word undergoes brace expansion, tilde expansion, parameter and variable expansion, command substitution, arithmetic expansion,
and quote removal. Pathname expansion and word splitting are not performed. The result is supplied as a single string, with a
newline appended, to the command on its standard input (or file descriptor n if n is specified).
It's like a here-doc but instead of lines, we have just a string
Your error means that you are using the posix shell sh, and here-string is not supported.
To fix this, use bash or use a pipe like this :
echo 'string' | command