What is the purpose of Team NPM accounts?
Team NPM accounts replace individual developer accounts when it comes to NPM package installation. Each team can have a single NPM user set up, that is shared amongst the developers. Projects then can be configured to use the team NPM credentials to install Mobiscroll.
What does it solve?
Since NPM access is based on user credentials, whenever a user changes their password, a project that was set up by them will lose access and will need to be set up again.
Also when a license is reassigned to another developer - that can happen for various reasons (developer leaving a team or working on something else) - they lose the access until Mobiscroll is reinstalled with the new credentials.
When using CI/CD environments, things can get even more problematic. Even if a developer changes their password, the CI/CD pipeline will break and won't be able run an npm update until a new login token is pushed in.
How to update a project to use a team NPM account instead of an individual user account?
Set up NPM access for your team
This can be done from the Licenses page by any developer.
Update the credentials in the CLI and reinstall Mobiscroll
Run a login command in the project's root folder.
mobiscroll login
When the Mobiscroll CLI prompts for credentials, enter the user and secret of team NPM account instead of the individual developer account.
Note: You might need to update the Mobiscroll CLI to the latest version.
Commit and push the login token into your repository
The login command will create or update a file called
.npmrc
or.yarnrc.yml
(for yarn users). This file contains the authorization token and it needs to be committed and pushed into your repository so that other developers and CI/CD environments are granted access to the packages.
Updating team NPM account credentials
Updating the credentials can be done from the Licenses page by any developer that is part of the team. After you update the user and/or the secret, the projects that were previously set up with the same account will lose access until the authorization tokens are updated.
First, click the "Change access" button
Generate a new secret by clicking the "Generate secret" button
Optionally change the username
Hit the save button to update the credentials
To update the authorization tokens, the mobiscroll login command needs to be run in the project's root folder:
mobiscroll login
After the Mobiscroll CLI prompts for the user and secret you can use the updated credentials to set the project up.
The login command will update the authorization token in a file called .npmrc
or .yarnrc.yml
(if you are using yarn instead of npm). This change has to be committed and pushed into the repository.