Unable to connect to wifi network

I’m unable to connect to wifi using:

nmcli d wifi con "wifiname" password "password"

this returns:

Error: Connection activation failed: Secrets were required, but not provided.
I am 100% sure I did not input the wrong password.

anyone knows a fix to this?

First, run:

nmcli device wifi list

Verify the exact spelling of the SSID. Then, run this:

nmcli device wifi con -a

This will prompt you for the SSID and the password. See if that yields different results perhaps?