You can get refresh token by curl
curl -d client_id={CLIENT_ID} \
-d client_secret={CLIENT_SECRET} \
-d grant_type=authorization_code \
-d code={CODE} \
-d redirect_uri={REDIRECT_URI} \
https://accounts.spotify.com/api/token

Step 1 - create your application
Create your App in Spotify Developer Dashboard
Get Client ID
, Client Secret
and add redirect URIs

Step 2 - Get code
https://accounts.spotify.com/authorize?response_type=code&client_id={your client id}&scope=user-read-email&redirect_uri={your redirect URL, mine is http://localhost:3000}
Browser will show code in the address control, copy the code
part.

Step 3 - Get refresh
Get refresh code by curl from terminal
curl -d client_id={your client it} \
-d client_secret={your client secret} \
-d grant_type=authorization_code \
-d code={code from Step #2} \
-d redirect_uri=http://localhost:3000 \
https://accounts.spotify.com/api/token | jq
You can get the refresh token
{
"access_token": "BQC...V-1"
"token_type": "Bearer",
"expires_in": 3600,
"refresh_token": "AQA...6twR
"scope": "user-read-email"
}
Reference
How to create a Spotify refresh token the easy way