Can't use env variables in the package.json file


In my ReactJS project, I am trying to use a dependency directly from a private GitHub repository. This was very helpful and I was able to use the dependency.

The problem is that I can’t use the credential using an environment variable.

npm install git+https://${GIT_TOKEN}

The ${GIT_TOKEN} is parsed as a string.

I tried to echo the value in pre:install and it worked there but not during the build.

Will I have to create my own build script/process? If yes, is there any guide or something?


hmm, not 100% sure this is quite the right thing, but maybe start here?