Considering the following problem
$\min ∥xs-e∥$ s.t $Ax=b$
,where we know that $A$ is a $m\times n$ matrix and $b$ is vector $m\times1$ .
Also vector $s$ is a $n\times1$ matrix with all its elements not negative
and $e$ is the vector with all its components equal to $1$.
$xs$ is the Hadamard product of $x$ and $s$ .
This is an easy to formulate and solve convex linearly-constrained least squares (2-normn) problem using CVX, CVXPY or similar tool.
In CVX under MATLAB: