Secret variables in `.npmrc` are not loaded, build fails

My .npmrc
@awesome.me:registry=https://npm.fontawesome.com/
@fortawesome:registry=https://npm.fontawesome.com/
//npm.fontawesome.com/:_authToken=${FONTAWESOME_AUTH_TOKEN}
@awesome.me:registry=https://npm.fontawesome.com/
@fortawesome:registry=https://npm.fontawesome.com/
//npm.fontawesome.com/:_authToken=${FONTAWESOME_AUTH_TOKEN}
Notice it has the FONTAWESOME_AUTH_TOKEN secret So I added the secret via the Cloudflare workers' website/UI (see attached image) But the deployment is failing. See build logs below:
No description
3 Replies
Baran
BaranOP5mo ago
2025-07-24T18:00:38.796Z Initializing build environment...
2025-07-24T18:00:48.175Z Success: Finished initializing build environment
2025-07-24T18:00:48.390Z Cloning repository...
2025-07-24T18:00:50.000Z Detected the following tools from environment: npm@10.9.2, nodejs@22.16.0
2025-07-24T18:00:50.002Z Restoring from dependencies cache
2025-07-24T18:00:50.005Z Restoring from build output cache
2025-07-24T18:00:50.415Z Installing project dependencies: npm clean-install --progress=false
2025-07-24T18:01:35.623Z npm warn deprecated @ryoppippi/unplugin-typia@2.6.5: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
2025-07-24T18:01:41.387Z npm error code E401
2025-07-24T18:01:41.388Z npm error Incorrect or missing password.
2025-07-24T18:01:41.388Z npm error If you were trying to login, change your password, create an
2025-07-24T18:01:41.389Z npm error authentication token or enable two-factor authentication then
2025-07-24T18:01:41.389Z npm error that means you likely typed your password in incorrectly.
2025-07-24T18:01:41.389Z npm error Please try again, or recover your password at:
2025-07-24T18:01:41.390Z npm error https://www.npmjs.com/forgot
2025-07-24T18:01:41.390Z npm error
2025-07-24T18:01:41.390Z npm error If you were doing some other operation then your saved credentials are
2025-07-24T18:01:41.390Z npm error probably out of date. To correct this please try logging in again with:
2025-07-24T18:01:41.390Z npm error npm login
2025-07-24T18:01:41.391Z npm error A complete log of this run can be found in: /opt/buildhome/.npm/_logs/2025-07-24T18_00_57_739Z-debug-0.log
2025-07-24T18:01:41.698Z Failed: error occurred while installing tools or dependencies
2025-07-24T18:00:38.796Z Initializing build environment...
2025-07-24T18:00:48.175Z Success: Finished initializing build environment
2025-07-24T18:00:48.390Z Cloning repository...
2025-07-24T18:00:50.000Z Detected the following tools from environment: npm@10.9.2, nodejs@22.16.0
2025-07-24T18:00:50.002Z Restoring from dependencies cache
2025-07-24T18:00:50.005Z Restoring from build output cache
2025-07-24T18:00:50.415Z Installing project dependencies: npm clean-install --progress=false
2025-07-24T18:01:35.623Z npm warn deprecated @ryoppippi/unplugin-typia@2.6.5: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
2025-07-24T18:01:41.387Z npm error code E401
2025-07-24T18:01:41.388Z npm error Incorrect or missing password.
2025-07-24T18:01:41.388Z npm error If you were trying to login, change your password, create an
2025-07-24T18:01:41.389Z npm error authentication token or enable two-factor authentication then
2025-07-24T18:01:41.389Z npm error that means you likely typed your password in incorrectly.
2025-07-24T18:01:41.389Z npm error Please try again, or recover your password at:
2025-07-24T18:01:41.390Z npm error https://www.npmjs.com/forgot
2025-07-24T18:01:41.390Z npm error
2025-07-24T18:01:41.390Z npm error If you were doing some other operation then your saved credentials are
2025-07-24T18:01:41.390Z npm error probably out of date. To correct this please try logging in again with:
2025-07-24T18:01:41.390Z npm error npm login
2025-07-24T18:01:41.391Z npm error A complete log of this run can be found in: /opt/buildhome/.npm/_logs/2025-07-24T18_00_57_739Z-debug-0.log
2025-07-24T18:01:41.698Z Failed: error occurred while installing tools or dependencies
Baran
BaranOP5mo ago
whats the difference? Can the issue be related to this?
No description
Baran
BaranOP4mo ago
“Build” allows the worker read env variables (which can be secret environment variables) at build time, the other is the same for runtime After setting a secret env variable at build time, the worker managed to read the variable in npmrc and install the private packages

Did you find this page helpful?