Skip to content

Instantly share code, notes, and snippets.

@biilmann biilmann/readme.md

Created Oct 14, 2015
Embed
What would you like to do?
Quick Guide to Private NPM Modules on Netlify

Using NPM Private Modules on Netlify

Create a .npmrc file for your project like this:

//registry.npmjs.org/:_authToken=${NPM_TOKEN}

Then find your token inside the ~/.npmrc file in your home folder and set it as an NPM_TOKEN environment variable through netlify's admin UI.

@bsdahl

This comment has been minimized.

Copy link

bsdahl commented Mar 8, 2019

How do you make this work in the local dev environment?

$ yarn
yarn install v1.13.0
error An unexpected error occurred: "Failed to replace env in config: ${NPM_TOKEN}".
@glennvgastel

This comment has been minimized.

Copy link

glennvgastel commented Mar 11, 2019

You set the env variable first.
Either inline : NPM_TOKEN=xxxxxxxxxx yarn
Or by setting it up for your system.

@brianzelip

This comment has been minimized.

Copy link

brianzelip commented Mar 31, 2019

EDIT

See this thread on the npm forum about configuring w/ env vars.

@nathanbirrell

This comment has been minimized.

Copy link

nathanbirrell commented Dec 30, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.