Using a github branch as a dependency (github:Discordjs/discord.js#branch-name)

Hello,

Recently, one of the discord.js branch got merged into the main discord.js master version and it solved my problem. However, before that, we were trying to install that specific branch as a dependency and the expected result didn’t happen for me.

I’ve tried installing the branch as a dependency by having the value be:

  1. “github:username/discord.js”
  2. “+https://www.github.com/username/discord.js.git”
  3. “github:discordjs/discord.js#xxxxx”; // where xxxxx is the branch number commit ID

However, when I look at the result that this branch brings to my project, it’s different from the expected result that other users of this branch have noted on their local computers.
On an important note, when I use the code enable-pnpm in glitch console to reinstall the dependencies (including the discord branch I’m interested in), I only see:

“Discord-newFeature”: “11.5.1”
where “Discord-newFeature” is the key/name and 11.5.1 is the latest version of Discordjs at this time; the point being there is no mention of the specific branch that I’m planning on using in the log!

Actually Discordjs team has accepted this branch and so far upon a little test, it seems the result is expected for now. But the topic of my post is about how to install a branch version of a github project as a dependency (as simply github:Discordjs/discord.js#branch-name isn’t working). Please inform me if I’m unable to install a branch of github project? or let me know if I’m actually installing this github branch and the problem lies somewhere else (despite the enable-pnpm log not showing any indication of the branch)?

You are able to install anything by cloning lib github repo to your project’s node_modules folder.