Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
I don't really understand why に used instead を even though 努める is transitive?
I think you're mixing up two different つとめる with different kanji. 努める is always intransitive.
務【つと】める (transitive; ～を務める): be in charge, play a role. Examples.
努【つと】める (intransitive; ～に努める): make an effort, endeavor. Examples.
And there is also 勤める.
Required, but never shown