Scopes and registry routes Lesson 2 of 10 ยท 2 minutes https://privatenpm.com/guides/npmrc-private-registry 00:00 One project. Two registries. Your project needs a private package and a public dependency. How does npm select the correct registry? Use a scope route and a separate credential. 00:12 Route the private scope Create a project .npmrc beside package.json. Route the Acme scope to your verified registry hostname. Set npmjs as the default registry for other names. Other configured scope routes still apply. 00:34 Match the credential to the host The credential line starts with two slashes and has no protocol. Use the same hostname as the registry route. A path can limit the credential to part of that host. For this registry, use the root path. 00:51 Commit the placeholder Keep the download key in the environment variable. npm replaces the variable placeholder when it reads .npmrc. Commit the placeholder. Do not commit the secret. 01:05 Follow each package request Requests for @acme/sdk go to your private registry. React uses npmjs, the default registry in this example. The key for your private host does not go to npmjs. 01:22 Use the same project context Run commands from the project directory. Command-line options and environment settings can override file settings. A package does not configure its recipients through the project .npmrc. 01:36 Verify the route and access First, inspect the scope route with npm config get. Then, use npm view to test package access. The test needs a published package and a valid download key. 01:50 Route first. Authorize separately. Does a scope route give package access? No. The registry controls access. Next, publish a private package.