I feel your pain on this one—debugging Teams/Office add-ins can be super frustrating, especially when you're doing everything right and still getting these cryptic TLS errors. So let’s break this down in a human, no-BS way:
🔍 What’s actually going wrong? The key error here is:
nginx Copy Edit UNABLE_TO_GET_ISSUER_CERT_LOCALLY Which basically means:
The tool (in this case, @microsoft/teamsapp-cli) tried to make a secure HTTPS request but couldn't verify the certificate authority (CA) of the server it was trying to talk to. It doesn't trust the chain. 🧠 Why is this happening? Even though your dev certs (localhost.crt, etc.) are trusted locally for dev (hence no browser warnings), the Teams Toolkit CLI or Node environment (used by axios, etc.) may not trust those same certs—especially on corporate machines, behind proxies, or on Windows with funky cert setups. ✅ Fixes to try (start with the easiest):
bash Copy Edit set NODE_EXTRA_CA_CERTS=C:\Users\admin-aja.office-addin-dev-certs\localhost.crt If you're using PowerShell:
powershell Copy Edit $env:NODE_EXTRA_CA_CERTS="C:\Users\admin-aja.office-addin-dev-certs\localhost.crt" Then re-run the command:
bash Copy Edit npx @microsoft/teamsapp-cli install --file-path "C:\Users\ADMIN-~3\AppData\Local\Temp\manifest.zip" 💡 If that works, you can add it to your start script or .env file. 2. 🔐 Make sure your machine trusts the cert Double-click on localhost.crt and ensure it’s installed in the Trusted Root Certification Authorities store for Local Machine or Current User.
Run:
bash Copy Edit npm config get proxy npm config get https-proxy If they're set and your proxy uses a self-signed cert, that could be breaking things. You’d have to export that cert and pass it as a trusted CA (same as above, using NODE_EXTRA_CA_CERTS). 4. ☠️ As a last resort – skip TLS verification (not recommended in production) Set this env var:
bash Copy Edit set NODE_TLS_REJECT_UNAUTHORIZED=0 ⚠️ Only use this for local debugging! It disables cert checking entirely. Note: You’ve done a solid job getting everything wired up. The manifest is valid, the dev server is running, certs are trusted by Office—it’s just the Teams CLI choking on that cert chain.
So yeah, try step 1 first—set NODE_EXTRA_CA_CERTS to point at your local .crt file and run again. That usually solves it for folks in environments with custom certs or local HTTPS setups.
Let me know what happens or if you want to jump on step 2 together. We’ll get it working.