From cf20fb1ac380c086ec38a093ff2bb414040d8774 Mon Sep 17 00:00:00 2001 From: jmarlena <6732600+jmarlena@users.noreply.github.com> Date: Wed, 18 Nov 2020 18:34:08 -0800 Subject: [PATCH] Npm audit follow-up PR (#16452) * Add scope flag examples and some context * Update reusables to new syntax * Apply suggestions from code review Co-authored-by: Kayla Ngan * Apply suggestions from code review Co-authored-by: Kayla Ngan --- .../configuring-npm-for-use-with-github-packages.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/content/packages/using-github-packages-with-your-projects-ecosystem/configuring-npm-for-use-with-github-packages.md b/content/packages/using-github-packages-with-your-projects-ecosystem/configuring-npm-for-use-with-github-packages.md index 24e868541915..491df51504ce 100644 --- a/content/packages/using-github-packages-with-your-projects-ecosystem/configuring-npm-for-use-with-github-packages.md +++ b/content/packages/using-github-packages-with-your-projects-ecosystem/configuring-npm-for-use-with-github-packages.md @@ -45,12 +45,15 @@ If your instance has subdomain isolation disabled: To authenticate by logging in to npm, use the `npm login` command, replacing *USERNAME* with your {% data variables.product.prodname_dotcom %} username, *TOKEN* with your personal access token, and *PUBLIC-EMAIL-ADDRESS* with your email address. +If {% data variables.product.prodname_registry %} is not your default package registry for using npm and you want to use the `npm audit` command, we recommend you use the `--scope` flag with the owner of the package when you authenticate to {% data variables.product.prodname_registry %}. + {% if enterpriseServerVersions contains currentVersion %} If your instance has subdomain isolation enabled: {% endif %} ```shell -$ npm login --registry=https://{% if currentVersion == "free-pro-team@latest" %}npm.pkg.github.com{% else %}npm.HOSTNAME/{% endif %} +$ npm login --scope=@OWNER --registry=https://{% if currentVersion == "free-pro-team@latest" %}npm.pkg.github.com{% else %}npm.HOSTNAME/{% endif %} + > Username: USERNAME > Password: TOKEN > Email: PUBLIC-EMAIL-ADDRESS @@ -60,7 +63,7 @@ $ npm login --registry=https://{% if currentVersion == "free-pro-team@latest" %} If your instance has subdomain isolation disabled: ```shell -$ npm login --registry=https://HOSTNAME/_registry/npm/ +$ npm login --scope=@OWNER --registry=https://HOSTNAME/_registry/npm/ > Username: USERNAME > Password: TOKEN > Email: PUBLIC-EMAIL-ADDRESS