necccc / npm-migrate

Migrate all versions of a selected package from a registry to another one
MIT License
21 stars 14 forks source link

[Question] How do I authenticate my private registry? #8

Closed dathdev closed 4 years ago

dathdev commented 4 years ago

I've been trying to use this script to migrate my npm packages from Azure to Nexus but both of them has authentication on them so it keeps giving me 401. Can I still use this script to migrate or do I need to think of some other way around? Thanks.

BBlackwo commented 4 years ago

@dathdev You just need to have access to read/publish to each private registry and then the script will work. When you authenticate, the credentials should be written to your .npmrc. Then this, or any script should work.

dathdev commented 4 years ago

@BBlackwo I can npm install a package from the source repo, but the script still fails with 401.

Edit: Added always-auth=true into .npmrc, worked perfectly. Thanks!