private npm packages

Is there a way to set up a NPM RC somewhere to access private npm packages? Thinking about a env variable like in Vercel for example
Solution:
Here is my workaround: 1) Create a railway.json file 2) Add this: ```{ "$schema": "https://railway.app/railway.schema.json",...
Jump to solution
3 Replies
Percy
Percy2y ago
Project ID: 638680ca-45d7-4296-9d7a-2aee8ac26871
Raigato
Raigato2y ago
638680ca-45d7-4296-9d7a-2aee8ac26871
Solution
Raigato
Raigato14mo ago
Here is my workaround: 1) Create a railway.json file 2) Add this:
{
"$schema": "https://railway.app/railway.schema.json",
"build": {
"builder": "NIXPACKS",
"nixpacksPlan": {
"phases": {
"npm:config": {
"dependsOn": ["setup"],
"cmds": [
"npm config set @my-scope:registry https://my.private.registry",
"npm config set //npm.pkg.github.com/:_authToken ${NPM_TOKEN}"
]
},
"install": {
"dependsOn": ["setup", "npm:config"]
}
}
}
}
}
{
"$schema": "https://railway.app/railway.schema.json",
"build": {
"builder": "NIXPACKS",
"nixpacksPlan": {
"phases": {
"npm:config": {
"dependsOn": ["setup"],
"cmds": [
"npm config set @my-scope:registry https://my.private.registry",
"npm config set //npm.pkg.github.com/:_authToken ${NPM_TOKEN}"
]
},
"install": {
"dependsOn": ["setup", "npm:config"]
}
}
}
}
}
3) Add a NPM_TOKEN variable with your token in your project
Want results from more Discord servers?
Add your server