How to set env var for .npmrc use
I need a module in my project to download a private npm package. To accomplish this, I am using a .npmrc file to supply a read-only token needed to download the package. To keep the token supplied by npm out of the file, I wish to add it as an environment variable and let it expand in the file. E.g: # .npmrc //registry.npmjs.org/:_authToken=${NPM_TOKEN} I can't figure out how to get that NPM_TOKEN added to the env before it is referenced for the install. I tried using an npm preinstall script: "preinstall": "NPM_READ_ONLY_TOKEN=my_token_goes_here_foo_bar" ** But I still get the same error: