Packaging with:
node-lambda package ...
will fail when package.json contains modules that are private on npm. I found a solution was to make a .npmrc file, put the following contents in it, and .gitignore it.
//registry.npmjs.org/:_authToken=00000000-0000-0000-0000-000000000000
However, as suggested on the npm docs, they recommend exporting an environment variable instead from your ~/.profile, or ~/.bashrc...
export NPM_TOKEN="00000000-0000-0000-0000-000000000000"
Then, use a NPM_TOKEN environment variable inside the .npmrc:
//registry.npmjs.org/:_authToken=${NPM_TOKEN}
How does one pass the NPM_TOKEN environment variable into the node-lambda package container so that it can be available when it executes npm install --production?
Packaging with:
node-lambda package ...will fail when
package.jsoncontains modules that are private on npm. I found a solution was to make a.npmrcfile, put the following contents in it, and.gitignoreit.However, as suggested on the npm docs, they recommend exporting an environment variable instead from your
~/.profile, or~/.bashrc...Then, use a
NPM_TOKENenvironment variable inside the.npmrc:How does one pass the
NPM_TOKENenvironment variable into thenode-lambda packagecontainer so that it can be available when it executesnpm install --production?