Search code examples
npmnpm-installnpm-publish

How to host TS declaration file package on private npm registry


RT

I want to host TS declaration file package (start with scope @types) on private environment.

Used two ways:

  1. Host it on private npm registry directly.

    • Cannot install it from specific registry without affect to other packages in @types scope.
  2. Host it on private http address.

    • It's difficult to update package version and maybe cause package hash integrity conflict in package-lock.

Solution

  • I've resolve it by host it on a private http address.

    Created version folder and put package in the version.

    Upgrade by change folder version.