Yes, you can avoid publishing on npm by installing the package directly from a GitHub or GitLab private repository. Simply use the command: npm install <git remote url>.
npm install <git remote url>