Code for robot wont work

I have done some more tests, and I have figured out and seen that it only cannot find the right port when the motor shield is plugged in. I tried just the uno and the lights turned on, and it found the correct port.