What is the best way to install private npm packages?

thenewnickyzzPRO

a year ago

My usecase is that my node app needs to install a package from a private github registry.
What I would normally expect is to be able to pass a .npmrc (like Vercel) or a token from the env variables and have the usual installation during the build step. As per my understanding this is not currently supported by railway.

So my question is, what would be the best workaround in this case? I'm not using a custom dockerfile for the build.

0 Replies

thenewnickyzzPRO

a year ago

project ID: 8a8bfe2d-1094-4b5f-834a-eba6388d0180


a year ago

You kinda answered it yourself.. Use a custom Dockerfile for the build


thenewnickyzzPRO

a year ago

I was hoping there would be an easier solution but thanks 😅


a year ago

That is the easiest solution, also means you dont have to rely on nixpacks to not break


What is the best way to install private npm packages? - Railway Help Station