-c, --count prefix lines by the number of occurrences
grep 'name = ' ms-litebox-Cargo.lock | sort | uniq -c | grep -v '1 name' | sort -n
Edit: Also, beware of the unsorted uniq count:
cat <<EOF | uniq -c > a > a > b > a > a > EOF 2 a 1 b 2 a