Find the Best Cosmetic Hospitals

Explore trusted cosmetic hospitals and make a confident choice for your transformation.

“Invest in yourself — your confidence is always worth it.”

Explore Cosmetic Hospitals

Start your journey today — compare options in one place.

Artifacatory: Upload Artifacts to Artifactory using NPM with Node.js Project

Step-by-Step Guide: Create a Node.js Project with npm and Upload Artifacts to Artifactory

1. Install Prerequisites

  • Node.js and npm: Download and install Node.js, which includes npm. Check installation with: textnode -v npm -v

2. Initialize a New Node.js Project

  • Create a new directory for your project and navigate into it: textmkdir my-node-project cd my-node-project
  • Initialize a Node.js project with: textnpm init Answer the prompts (project name, version, etc.) or use npm init -y to accept the defaults and generate package.json12345.

3. Develop Your Node.js Artifact

  • Add your source files. Commonly, you’ll have an index.js or main.js, and add dependencies as needed: textnpm install <dependency>

4. Configure Artifactory for npm Publish

a. Obtain Artifactory Information

  • You need:
    • Your Artifactory npm repository URL (e.g., https://company.jfrog.io/artifactory/api/npm/npm-local/)
    • Your Artifactory username and API key or password

b. Set the Registry in Your Project

  • Add the publishConfig block to your package.json to specify the Artifactory registry: json"publishConfig": { "registry": "https://company.jfrog.io/artifactory/api/npm/npm-local/" } Replace the URL with your actual Artifactory repository URL678.

c. Authenticate npm with Artifactory

  • To authenticate, run in your terminal (replace the URL with your Artifactory npm repository): textnpm login --registry=https://company.jfrog.io/artifactory/api/npm/npm-local/ Enter your Artifactory credentials. This creates or updates the .npmrc file with authentication tokens for your registry67.

5. Publish Your Artifact to Artifactory

  • Once you’re ready to upload: textnpm publish This command will upload your package based on the configuration in publishConfig. Alternatively, you can override the registry in the publish command: textnpm publish --registry=https://company.jfrog.io/artifactory/api/npm/npm-local/

6. (Optional) Extra Security

  • For automation or CI/CD, pass your credentials via environment variables or a CI secrets manager. Do not commit credentials or .npmrc with auth tokens to source control.

Summary Table

StepCommand/Action
New Projectnpm init / npm init -y
Add Files/DependenciesAdd code and run npm install <package>
Configure RegistryEdit package.json / run npm login
Set Credentialsnpm login --registry=<artifactory_url>
Publish Artifactnpm publish (uses registry from package.json or CLI)

With these steps, you can create a Node.js project, configure it for npm, and securely publish your artifact to Artifactory using npm’s built-in tooling.

Another Method

Find Trusted Cardiac Hospitals

Compare heart hospitals by city and services — all in one place.

Explore Hospitals
I’m a DevOps/SRE/DevSecOps/Cloud Expert passionate about sharing knowledge and experiences. I have worked at <a href="https://www.cotocus.com/">Cotocus</a>. I share tech blog at <a href="https://www.devopsschool.com/">DevOps School</a>, travel stories at <a href="https://www.holidaylandmark.com/">Holiday Landmark</a>, stock market tips at <a href="https://www.stocksmantra.in/">Stocks Mantra</a>, health and fitness guidance at <a href="https://www.mymedicplus.com/">My Medic Plus</a>, product reviews at <a href="https://www.truereviewnow.com/">TrueReviewNow</a> , and SEO strategies at <a href="https://www.wizbrand.com/">Wizbrand.</a> Do you want to learn <a href="https://www.quantumuting.com/">Quantum Computing</a>? <strong>Please find my social handles as below;</strong> <a href="https://www.rajeshkumar.xyz/">Rajesh Kumar Personal Website</a> <a href="https://www.youtube.com/TheDevOpsSchool">Rajesh Kumar at YOUTUBE</a> <a href="https://www.instagram.com/rajeshkumarin">Rajesh Kumar at INSTAGRAM</a> <a href="https://x.com/RajeshKumarIn">Rajesh Kumar at X</a> <a href="https://www.facebook.com/RajeshKumarLog">Rajesh Kumar at FACEBOOK</a> <a href="https://www.linkedin.com/in/rajeshkumarin/">Rajesh Kumar at LINKEDIN</a> <a href="https://www.wizbrand.com/rajeshkumar">Rajesh Kumar at WIZBRAND</a> <a href="https://www.rajeshkumar.xyz/dailylogs">Rajesh Kumar DailyLogs</a>

Related Posts

Artifactory: Comprehensive Troubleshooting Guide for JFrog Artifactory

Here’s a very comprehensive, up-to-date troubleshooting guide for JFrog Artifactory 7.x, covering the application, database, core components, all services, log files, and all the key troubleshooting commands.This…

Read More

Artifactory: Setting up Artifactory 7 High Availability Cluster

Here is a comprehensive, step-by-step guide to design, configure, and deploy JFrog Artifactory 7.x in High Availability (HA) mode—including all architectural and configuration considerations required for a…

Read More

Artifactory: Guide to change Artifactory filestore to AWS EFS (Elastic File System)

Here’s a comprehensive, step-by-step tutorial for migrating or configuring JFrog Artifactory 7.117.7+ (self-hosted, Linux) to use AWS EFS (Elastic File System) as its filestore. This guide brings…

Read More

Artifactory: using Gradle and Uploading Artifacts to Artifactory

Step-by-Step Guide: Creating a Java Project with Gradle and Uploading Artifacts to Artifactory 1. Install Prerequisites 2. Create a New Java Project Using Gradle Open your terminal…

Read More

Jfrog Artifactory: Install Artifactory 7 with Postgresql

Here’s a clear, step-by-step command guide to install the latest JFrog Artifactory (7.117.7) on a Linux server with PostgreSQL as the external database. This walkthrough assumes Ubuntu/Debian,…

Read More

Package Types Supported by Artifactory

Here is a short summary of each of the mentioned package types: Complete List of Package Types Supported by JFrog Artifactory JFrog Artifactory is recognized for its…

Read More
Subscribe
Notify of
guest
1 Comment
Newest
Oldest Most Voted
Inline Feedbacks
View all comments
Jason Mitchell
Jason Mitchell
1 month ago

Nice guide! It clearly shows how to create a Node.js project and upload npm artifacts to Artifactory step by step. Very useful for anyone working with Artifactory and npm. 

1
0
Would love your thoughts, please comment.x
()
x