You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
tsp install does not respect the user-level .npmrc file, causing it to always fetch packages from the default npmjs.org registry instead of any configured alternative registry.
Category: Bug Area: compiler:core
⚠️ No reproduction provided. A minimal repro would help diagnose this issue.
🔍 Analysis
tsp install invokes npm under the hood to install TypeSpec dependencies. The issue is that the npm invocation may be ignoring the user-level ~/.npmrc or project-level .npmrc that specifies an alternative registry.
This affects users in corporate/private environments who must route npm traffic through an internal registry (e.g., Azure Artifacts, Verdaccio, Nexus).
Root cause is likely that tsp install either uses a hardcoded registry URL, passes --registry explicitly, or spawns npm in a way that bypasses the standard .npmrc lookup.
Affected component: packages/compiler — the tsp install CLI command implementation.
📝 Suggested next steps
Locate the tsp install implementation in packages/compiler and check how npm is invoked
Verify whether a --registry flag or environment variable is being hardcoded
Ensure npm is invoked in a way that respects the user's .npmrc (e.g., do not override registry)
Add a test or note that validates .npmrc registry configuration is honored
So the problem with respecting .npmrc and NPM_CONFIG_REGISTRY is that typespec is package manager agnostic. Doing a bit of research other packages managers do not usually respect the NPM_CONFIG_REGISTRY var and have their own. As for npmrc it is a bit more but yarn 2+ doesn't respect it either.
In practice tsp install just install the configured package manager(similar to how corepack did it) and run the install command for it(delegating to its own install logic). So you should need the TYPESPEC_NPM_REGISTRY env + whatever package manager you use config but after that everything should work. I am a bit more reluctant to change that right now without any strong ask.
Activity
github-actions commentedon Aug 14, 2026
🎯 Issue Triage
tsp installdoes not respect the user-level.npmrcfile, causing it to always fetch packages from the default npmjs.org registry instead of any configured alternative registry.Category: Bug
Area:
compiler:core🔍 Analysis
tsp installinvokes npm under the hood to install TypeSpec dependencies. The issue is that the npm invocation may be ignoring the user-level~/.npmrcor project-level.npmrcthat specifies an alternative registry.tsp installeither uses a hardcoded registry URL, passes--registryexplicitly, or spawns npm in a way that bypasses the standard.npmrclookup.packages/compiler— thetsp installCLI command implementation.📝 Suggested next steps
tsp installimplementation inpackages/compilerand check how npm is invoked--registryflag or environment variable is being hardcoded.npmrc(e.g., do not override registry).npmrcregistry configuration is honoredDisable e2e tests (#11687)
timotheeguerin commentedon Aug 27, 2026
So the problem with respecting .npmrc and NPM_CONFIG_REGISTRY is that typespec is package manager agnostic. Doing a bit of research other packages managers do not usually respect the
NPM_CONFIG_REGISTRYvar and have their own. As for npmrc it is a bit more but yarn 2+ doesn't respect it either.In practice
tsp installjust install the configured package manager(similar to how corepack did it) and run the install command for it(delegating to its own install logic). So you should need the TYPESPEC_NPM_REGISTRY env + whatever package manager you use config but after that everything should work. I am a bit more reluctant to change that right now without any strong ask..npmrcregistryNPM_CONFIG_REGISTRYPNPM_CONFIG_REGISTRY.yarnrc.ymlYARN_NPM_REGISTRY_SERVERBUN_CONFIG_REGISTRYCOREPACK_NPM_REGISTRYSupport registry mirrors in tsp install (microsoft#11776)