How to install private npm packages OR from private Github repositories


#1

As do not to how to install a private npm package on Glitch, I am trying to install from a private repository on Github.

Here is the link I am using: git+https://<access_token>:x-oauth-basic@github.com/<user>/<respository>.git

This is working good and as expected offline on my iMac, but having hard luck on Glitch. I am getting this error in console log:

ERROR  Command failed: git ls-remote --refs git+ssh://git@github.com/<user>/<repository>.git master
No user exists for uid <uid>
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.

I do not understand why Glitch is changing https to ssh and defaulting to git user.
Any help will be greatly appreciated. I do not want to make the module public on Github or npmjs yet.


#2

Hey @rehmat sorry for the inconvenience; would you be willing to add https://github.com/cori/ as a collaborator on the repo so I can take a look? I may not get to it until tomorrow, but it would be better to be able to test with an actual npm module repo.


#3

Thanks cori!

But, I decided to make a module instead.
Please check it here: https://www.npmjs.com/package/node-repository-require

Works like a charm for me.


#4

That doesn’t work for me. My theory is that newer projects use pnpm by default, meaning that /app/node_modules/ is no longer used
Proof: require.resolve("discord.js") returns /rbd/pnpm-volume/.../node_modules/.registry.npmjs.org/discord.js/11.4.2/node_modules/discord.js/src/index.js


#5

Hi KinectTheUnknown, you can try using NPM. To do that run enable-npm in the terminal.


#6

Thank you for that, Melissa. I would still like Glitch to support dependancies in private Github repos.


#7

We encourage you to create feature request topic for this so other users can vote on it, and it will happen faster. Thanks.