Is the problem with the definition related to the fact that it doesn't specify sign, so then -1 would be the only "prime" number?
Actually is worse. There would be no prime numbers as for any $x \in \mathbb R$ then $x = n*\frac xn$ for any integer $n$ so $x$ has infinitely many divisors and can't be prime. $3$ is not prime because $\frac 32, \frac 34, \frac 35$, etc all divide $3$. (The definition of $a$ divides $b$ is that there exists an integer $k$ so that $b = ka$. There is nothing in the definition that says $a$ and $b$ are integers)
The definition of "Having only $1$ and itself as divisor" assumes that we are only considering natural numbers (i.e. positive integers) and even then we are considering $1$ and "itself" to be different.
This definition is not even considering negative numbers to be considered. Nor is it considering that that rational non integers can be divisors.
Which is okay. We just have to be specific. The following would be a perfectly acceptable definition:
A natural number is prime if it has exactly two natural divisors; itself and $1$.
We can extend it extend this to all integers by saying a prime in any integer other than $\pm 1$ with only two positive integer divisors; $1$ and the absolute value of itself. ... or a prime number is an integer which can not be expressed as a product of two or more non-unit ($\pm 1$) integers.
With more abstract algebraic concepts we can define primes more precisely as Flowers' answer and various comment links explain. These also allow for primes in systems other than just the integers.