Private npm Modules
For Node.js projects you might be using private npm modules as dependencies. You can follow the steps below to ensure they are made available during the build process.
-
Get your npm authentication token
This is usually in a
~/.npmrc
file on your local machine. Follow these steps to get your token. -
Add your npm token as a secret
Just like any other environment variable, follow these steps to add your token as a secret in the Seed console. For this example we will name your environment variable
NPM_TOKEN
. -
Store your token in the build process
Add the following to your build spec (
seed.yml
).before_compile: - echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
This uses the
NPM_TOKEN
environment variable from the previous step to create a.npmrc
file to reference your private npm modules.
That’s it! This should tell npm to use your token to reference your private modules.
Help improve this page. Edit it with GitHub
Was this page helpful? Let us know via Twitter
Having trouble configuring a CI/CD pipeline for your Serverless apps? Let Seed do it for you!
Learn More