Error with Conda build of Juyterlab using the Jupyterlab-feedstock and using a private NPM repository

Trying to build a Docker image that creates a Jupyterlab conda package using the Jupyterlab-stock as the template for the conda build recipe… The NPM packages are all stored in our enterprise NPM registry (Artifactory). Furthermore, the _auth property in the .npmrc file has been parameterized to accept a Docket build argument called ${NPM_TOKEN}.

NPM authentication works – with the above parameterization.

However, later on in the conda build process there is a failure. See below.

error An unexpected error occurred: “Failed to replace env in config: ${NPM_TOKEN}”.

Not sure how to resolve this error. Please advise.

Shown below are 3 snippets that illustrate this scenario.

1) Partial stack trace.

Running command /opt/conda/conda-bld/jupyterlab_1586533270382/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_pl/bin/python -u -c ‘import sys, setuptools, tokenize; sys.argv[0] = ‘"’"’/tmp/pip-req-build-g5dssshq/setup.py’"’"’; file=’"’"’/tmp/pip-req-build-g5dssshq/setup.py’"’"’;f=getattr(tokenize, ‘"’"‘open’"’"’, open)(file);code=f.read().replace(’"’"’\r\n’"’"’, ‘"’"’\n’"’"’);f.close();exec(compile(code, file, ‘"’"‘exec’"’"’))’ bdist_wheel -d /tmp/pip-wheel-avt1hyzd
running bdist_wheel
running jsdeps
Installing build dependencies with npm. This may take a while…

node /tmp/pip-req-build-g5dssshq/jupyterlab/staging/yarn.js install
yarn install v1.21.1
error An unexpected error occurred: “Failed to replace env in config: ${NPM_TOKEN}”.
info If you think this is a bug, please open a bug report with the information provided in “/tmp/pip-req-build-g5dssshq/jupyterlab/staging/yarn-error.log”.

  1. Redacted .npmrc file

registry=https://artifactory.xxxxxx.xxxxx.com/artifactory/api/npm/registry.yarnpkg.com/
_auth={NPM_TOKEN} email={NPM_EMAIL_ADDR}
always-auth=true
strict-ssl=false

3) Redacted Dockerfile snippet of Jupyterlab conda build step

RUN cd /jupyterlab-feedstock/recipe &&
npm get registry &&
conda build -c https://{USERNAME}:{PASSWORD}@artifactory.xxxxxx.xxxxx.com/artifactory/conda.anaconda.org-conda-forge
-c https://{USERNAME}:{PASSWORD}@artifactory.xxxxxx.xxxxx.com/artifactory/repo.anaconda.com-main
.