If you receive the “no such device” error when running gpg --card-status, you can use the sections below to troubleshoot.
Using YubiKey Manager, ensure that the CCID USB interface is enabled and the OpenPGP application is enabled over USB.
Remove and reinsert the YubiKey. Sometimes, the GPG agent does not correctly detect if the YubiKey is plugged in.
Force GPG agent to restart by running the following command in Command Prompt (Windows) or Terminal (macOS / Linux): gpgconf --kill gpg-agent
If GPG is still not detecting the YubiKey, you may need to change some of GPG’s options. Using a text editor, add the line “reader-port Yubico Yubikey” for YubiKey NEO and YubiKey 4, "reader-port Yubico YubiKey" for YubiKey 5 (without quotes) to your scdaemon.conf file. If the file does not exist, create it.
On Windows, this is saved at: %APPDATA%\gnupg\scdaemon.conf
On macOS and Linux, this is saved at: ~/.gnupg/scdaemon.conf
Once you have added these options, restart the GPG agent by running the command below in Command Prompt (Windows) or Terminal (macOS / Linux).
gpgconf --kill gpg-agent