If you’re receiving an SFDSX refresh token auth error, then you’ve probably encountered the problem at some point in your application’s lifecycle. This problem is caused by your authentication provider not providing you with a refresh token. Until you fix this problem, your org will be unable to access named credentials. Fortunately, there are many solutions available. Listed below are some common fixes.
First, make sure that your setup is correct. In order to use Salesforce’s external services, you need to authenticate your users. You must set up the appropriate configs in your production organization, including the sfdx-plugin-auth-url environment variable. In case you don’t know what those settings are, use the sfdx-lwc-jest command.