If $(X,d)$ is compact (why?) and $(E,d')$ is complete then $\mathscr{C}(X,E)$ is complete (equipped with the topology of unif. convergence). A theorem in a book that I am looking into states that if $(X,d)$ is compact and $(E,d')$ is complete then $\mathscr{C}(X,E)$ is complete (equipped with the metric $d_u$ of uniform convergence).

Now the thing is that I do not see why the compactness on $(X,d)$ is necessary. Is it maybe so that $d_u(f,g)$ would be finite for $f, g \in \mathscr{C}(X,E)$?

Can we "overcome" this problem if we replace $d'$ by $d''= \frac{d'}{1+ d'}$ as a metric on $E$?
The condition that $X$ is compact is essential, because:


Every continuous function on a compact set is bounded.  The uniform  metric is given by $d(f,g)=\sup_{x\in X}|f(x)-g(x)|$.  Since the function is bounded the set $\{f(x):x\in X\}$ is bounded and so its supremum exits.
The condition that $X$ is compact is essential, because:


Every continuous function on a compact set is bounded.  The uniform  metric is given by $d(f,g)=\sup_{x\in X}|f(x)-g(x)|$.  Since the function is bounded the set $\{f(x):x\in X\}$ is bounded and so its supremum exits.