This is not correct. First, we can see at least two ways a priori that something's amiss.
First: Consider instead the homeomorphic $\mathcal{A}^{\mathbb{N}}$. This maps continuously onto $[0, 1]$ by $(a_n)_{n \in \mathbb{N}} \mapsto \sum_{n = 1}^{\infty} (a_n - 1) k^{-n}$ (i.e. by considering a sequence as a $k$-ary expansion). If every subset of $X$ was compact, then so would be every subset of $[0, 1]$.
Second: Another way to see it would be that $X$ is Hausdorff, and every compact subset of a Hausdorff space is closed. Thus if a Hausdorff space has only compact subsets, it must be discrete.
These are all indirect ways about it, but to construct a counterexample we could just take $X \setminus \{ \mathbf{x} \}$ for some element $\mathbf{x}$. I'm gonna proceed as if this were $\mathcal{A}^{\mathbb{N}}$ for convenience. Set $\mathbf{x} = (x_n)_{n \in \mathbb{N}}$, and let
\begin{align*}
U_m & = \bigcup_{(y_1, \ldots, y_m) \neq (x_1, \ldots, x_m)} [y_1 , \ldots , y_m] .
\end{align*}
Then we can see that $\{ U_m : m \in \mathbb{N} \}$ is an open cover of $X \setminus \{ \mathbf{x} \}$, but if we look at, say, only $U_1 \cup \cdots \cup U_M$, then we can look at $\mathbf{z} = (z_n)_{n \in \mathbb{N}}$, where
$$z_n = \begin{cases} x_n & n \neq M + 1 \\
c & n = M + 1 ,
\end{cases}$$
and $c \neq x_{M + 1}$. Then $\mathbf{z} \in X \setminus \{ \mathbf{x} \}$, but $\mathbf{z} \not \in U_1 \cup \cdots \cup U_M$. Thus $\{ U_m : m \in \mathbb{N} \}$ is an open cover of $X \setminus \{ \mathbf{x} \}$ which admits no finite subcover.
While you're at it, you can see $X \setminus \{ \mathbf{x} \}$ isn't closed, as any cylinder about $\mathbf{x}$ would contain other (in fact uncountably many) elements.