.npmrc - env vars not expanded?

Problem

I need to easily install packages based on some predefined variables.

So i set

export NPMDIR=dev

or

export NPMDIR=prod

then in .npmrc

prefix=/usr/local/npm/$NPMDIR

and all packages are installed in /usr/local/npm/$NPMDIR literally instead of /usr/local/npm/dev, /usr/local/npm/prod etc.

Any clues?

Problem courtesy of: Ocean Moon

Solution

most likely you need brackets around your variables:

prefix=/usr/local/npm/${NPMDIR}
Solution courtesy of: user904990

Discussion

There is currently no discussion for this recipe.

This recipe can be found in it's original form on Stack Over Flow.