I want to get number of members with a role, but always give me "1":
const server_roles = client.guilds.cache.get('server ID').roles.cache.get('role ID').members.size;
console.log(server_roles)
Log:

Real role member count = 4, not 1
I want to get number of members with a role, but always give me "1":
const server_roles = client.guilds.cache.get('server ID').roles.cache.get('role ID').members.size;
console.log(server_roles)
Log:

Real role member count = 4, not 1
The issue isn't within your code, it's to do with the information bots can access after a recent update. In order to fix this:
BotPrivileged Gateway IntentsPRESENCE INTENT and SERVER MEMBERS INTENTThen, in the code, when initialising your Discord client, add this:
Discord.Client({ ws: { intents: Discord.Intents.ALL } });
That code assumes you've imported the module as Discord
It's quite complex, but after the recent update it's the only way to achieve what you want