From 7e871540bf084dfac40fbfbe0a2496fc6bd4ba94 Mon Sep 17 00:00:00 2001 From: addniner Date: Thu, 5 Mar 2026 22:32:03 +0900 Subject: [PATCH] fix(functions): forward NPM_AUTH_TOKEN to deploy bundler container The Docker bundler for `functions deploy` only passes `NPM_CONFIG_REGISTRY` to the container environment. When `.npmrc` uses \${NPM_AUTH_TOKEN} for private registry authentication, the variable is not available inside the container, causing 401 errors. Forward `NPM_AUTH_TOKEN` from the host environment to the Docker container, following the same pattern established in PR #3020 for `NPM_CONFIG_REGISTRY`. Closes #4927 --- internal/functions/deploy/bundle.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/internal/functions/deploy/bundle.go b/internal/functions/deploy/bundle.go index ae807aa01f..5946edffe9 100644 --- a/internal/functions/deploy/bundle.go +++ b/internal/functions/deploy/bundle.go @@ -68,6 +68,9 @@ func (b *dockerBundler) Bundle(ctx context.Context, slug, entrypoint, importMap if custom_registry := os.Getenv("NPM_CONFIG_REGISTRY"); custom_registry != "" { env = append(env, "NPM_CONFIG_REGISTRY="+custom_registry) } + if authToken := os.Getenv("NPM_AUTH_TOKEN"); authToken != "" { + env = append(env, "NPM_AUTH_TOKEN="+authToken) + } // Run bundle if err := utils.DockerRunOnceWithConfig( ctx,