NPM ssh dependancy

Hi I'm running into an issue where I'm using a private github npm dependancy and the build step is giving me back an "Unauthorized". I can't use private tokens and so the only way I can see is by doing it through github ssh. Is there anyway to authorize a container with github ssh? I've tried through the railway cli but it didn't seem to work. Any help would be appreciated!
15 Replies
Percy
Percy15mo ago
Project ID: 6cd21bc3-1e57-4c31-b7d1-7eec426fca78
Will Scott-Rodriguez
6cd21bc3-1e57-4c31-b7d1-7eec426fca78
Brody
Brody15mo ago
theres no official way to ssh into a container, and especially no way to do it during build, but lets see if we can find a way around this, how would you normally authorize npm to install this private dependency
Will Scott-Rodriguez
In local development I've just been using git ssh authentication. The private repository is in my github that is linked to railway but npm can't access it. I've looked at just linking the private npm package inside the main repo with npm link but from what i've seen that's very messy
Will Scott-Rodriguez
Sorry, should change the description to note not a direct SSH connection but adding ssh authentication for git. This is what i've been doing: https://docs.github.com/en/authentication/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent
Brody
Brody15mo ago
what is the easiest way to do this though? can you provide the username and password to your github as command flags? can you provide the username and password in the url to the private dependency? what are all the options?
Will Scott-Rodriguez
Usually the process requires me to generate a key on the terminal using ssh-keygen -t ed25519 -C "[email protected]"
Brody
Brody15mo ago
what are all the options
Will Scott-Rodriguez
What do you mean all the options? Inside Github? I can add the ssh key generated inside there. That's all.
Brody
Brody15mo ago
all the possible options for authorizing npm to install a private dependency so far ive only seen one
MantisInABox
MantisInABox15mo ago
Currently no support for private npm 📦
Brody
Brody15mo ago
vin is the ssh key the only way?
MantisInABox
MantisInABox15mo ago
As far as I’m aware, yeah. Angelo has said a few times that there is no way to do it yet™️
Brody
Brody15mo ago
i see
Will Scott-Rodriguez
Thanks guys, hopefully in the future then. So I'll just have to bundle it in the actual repo kekw
Want results from more Discord servers?
Add your server