How to install private npm package in bit.dev?

623 Views Asked by At

I'm try to install a private NPM package but is failing when using bit install.

I also tried using yarn install to add the package just to check if I have the right access and it works. yarn installation

Here's the screenshot of the error encountering when installing. bit installation

It is looking at https://node.bit.cloud/ instead of https://registry.npmjs.org/.

Thanks in advance for the help.

1

There are 1 best solutions below

0
On

I was also coming across the same issue from the consuming side. And it's definitely the setting of the bit auth token. Sometimes it's invalid when setting it within .npmrc. (run npm config list) Sometimes works, sometimes doesn't. But, what solved it for me was setting via cmd line like so:

npm config set BIT_REGISTRY=https://node.bit.cloud
npm config set @teambit:registry=https://node.bit.cloud
npm config set //node.bit.cloud/: authToken ${BIT_TOKEN}
npm i