MYHOSPITALNOW.COM

Find Trusted Doctors & Hospitals

Discover healthcare providers, compare hospitals, and explore treatment options worldwide.

Free Treatment Quotes • Doctor Search • Hospital Comparison

Find Healthcare Options

www.myhospitalnow.com

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 Rajesh Kumar, a DevOps, SRE, DevSecOps, Cloud, and Platform Engineering expert passionate about sharing practical knowledge, real-world experiences, and industry best practices. I have worked at Cotocus and regularly write about technology, travel, investing, health, product reviews, and digital marketing through my various platforms. I publish technical articles at DevOps School, travel stories at Holiday Landmark, stock market insights at Stocks Mantra, health and fitness guidance at My Medic Plus, product reviews at TrueReviewNow, and SEO and digital marketing strategies at Wizbrand.

Related Posts

Grunt Training Guide: Course Outline, Hands-On Labs, and CI Workflow

This updated guide turns a legacy Grunt course post into a practical training reference for developers and DevOps teams. It includes a structured curriculum, build workflow, sample Grunt configuration, CI example, and tool comparisons.

Read More

Complete Marp installation + command + examples guide

Marp is a Markdown presentation ecosystem. Marp CLI converts Marp/Marpit Markdown files into static HTML/CSS, PDF, PowerPoint/PPTX, and images. The official CLI docs also say Node.js v18+…

Read More

How to downgrade npm version?

How to downgrade npm version? Error:- Error Explanation :- My project which is made earlier, uses the older version of node but now i m cloning my…

Read More

NPM Error: Node Sass does not yet support your current environment

Deepak Kumar MotoShare.in is your go-to platform for adventure and exploration. Rent premium bikes for epic journeys or simple scooters for your daily errands—all with the MotoShare.in…

Read More

npm error on Linux: Node Sass could not find a binding for your current environment: Linux 64-bit with Node.js 12.x

Environment:Linux 64-bitLaravel 5.5Node.js 12.x How I got this error:I made some changes in one of the js file of my project. Hence, I needed to rebuild the…

Read More

npm – Node Packaged Modules

Install a package SYNOPSIS npm install (with no args in a package dir) npm install <tarball file> npm install <tarball url> npm install <folder> npm install <name>…

Read More
Subscribe
Notify of
guest
1 Comment
Newest
Oldest Most Voted
Jason Mitchell
Jason Mitchell
8 months 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