From chemfig documentation, page 8.
It seems like \setchemfig is not defined:
\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage{textcomp}
\usepackage[italian]{babel}
\usepackage{chemfig}
\begin{document}
\setchemfig{atom sep=50pt}
\chemfig{A-B}
\end{document}
! Undefined control sequence.
l.9 \setchemfig {atom sep=50pt} The control sequence at the end of the top line of your error message was
never \def'ed. If you have misspelled it (e.g., `\hobx'), type `I' and
the correct spelling (e.g., `I\hbox'). Otherwise just continue, and
I'll forget about whatever was undefined.
Client: Texmaker 4.5 Compiler: XeLaTeX
\setchemfigwas introdued with version 1.3. You will recieve the above described error if you try to use this command with an older version of thechemfigpackage. – leandriis May 10 '18 at 10:38chemfig, you can also use the matching command\setatomsep{50pt}that is obsolete with newer versions. – leandriis May 10 '18 at 10:43