[verb (dictionary form)] + しかない [noun] + しか + ない
しかない after a dictionary-form verb means "have no choice but to": every other option is gone, and this is the one left. It carries a note of resignation.
The verb in front stays in the dictionary form whatever the tense. The past goes on ない.
After a noun or a number, しか with ない means "only", and the amount feels too small. しか replaces が and を, and comes after other particles.
だけ is a plain "only": みっつ三つだけある just counts them, and みっつ三つしかない complains that three isn't enough.しかない is everyday Japanese, and polite speech turns ない into ありません. In formal writing, ほかない and よりほかない mean the same after a verb, and ざるをえない得ない, "be forced to", sounds heavier still.