The woman knew about the command, but she had not yet had a physical body when it was spoken not to eat of that tree.
Great point!
That’s a great walkthrough of the beginning of humankind. It was only matter of time when one of them tastes the forbidden fruit even if the women was told not to eat the fruitafter she became a woman.