Skip to content

Instantly share code, notes, and snippets.

@btopro
Last active September 30, 2021 14:02
Show Gist options
  • Save btopro/62bec6b828d6a836d58fabe7649ee3cf to your computer and use it in GitHub Desktop.
Save btopro/62bec6b828d6a836d58fabe7649ee3cf to your computer and use it in GitHub Desktop.

NPM publishing

  • make an account on npmjs.com
  • verify your email address
  • make an organization that's the same name as your github but lowercase (do this on npm)
  • Add the other team members to the organization (1 person leads in doing this while the others get added in, like github)

Go to your project's main directory for your button

  • type npm login and login with your credentials / email address you entered
  • Edit the package.json file and make the following changes:
  • "version" set this to somethin like "0.0.1" as this will be your 1st version / a test
  • find "name" and change this to be something like : "name": "@yourorganization/your-button" where yourorganization is the one you created and your-button is the name of your tag. @ and the / between org and project are required
  • Add the following to your package.json toward the bottom (making sure it's still valid json)
  "private": false,
  "publishConfig": {
    "access": "public"
  }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment