Discord RPC "could not connect

console saying Error: Could not connect

My code;

const RPC = require("discord-rpc");
const bot = new RPC.Client({ transport: 'ipc' });
const clientId = "583068470250307604";

bot.on("ready", () => {
        console.log("RPC Ready");
});
bot.login({ clientId }).catch(console.error);