Breakdown of Tentei alinhar a prateleira, mas não consegui.
não
not / no
mas
but
tentar
to try
conseguir
to manage / to get / obtain
Questions & Answers about Tentei alinhar a prateleira, mas não consegui.
Why isn't there a pronoun after consegui to mean "I couldn't do it"?
This is the inanimate null object in action. In English, you need a pronoun ("I couldn't do it" or "I couldn't manage it"), but in Portuguese, when the direct object refers to an inanimate thing or an abstract concept (like the action of aligning a prateleira), you can simply drop the pronoun. Saying não consegui on its own is the most natural way to express this.
Why is the translation "I couldn't" using consegui instead of pude (from poder)?
Conseguir specifically means to manage to do something, or to succeed after making an effort. Since the first half of the sentence sets up an attempt with tentei (I tried), the natural contrast for failing that attempt is não consegui (I didn't manage to / I didn't succeed). Não pude would imply an external factor prevented you from even being able to try.
Are there any prepositions missing before alinhar? I sometimes get confused about when to use a or de before an infinitive.
You don't need one here! The verbs tentar (to try) and conseguir (to manage) connect directly to the infinitive that follows them. So, it is always just tentei alinhar and consegui alinhar, with no prepositions needed in between.