Step 1 – Create a npm nexus repo
Step 2 – Step 2 – Install Node in your server
Step 3 – Create a Sample Project using NPM
$ mkdir npmprj
$ cd npmprj/
$ npm init
$ vi index.js
$ npm install express --save
$ npm publishStep 4 – Create a Nexus ID n Pass which has deploy access to npm repo in nexus.
# Convert user id and password to encoded token usign base64
$ echo -n 'myuser:mypassword' | openssl base64Code language: PHP (php)Step 5 – Create .npmrc with a REPO Location and Access to upload
registry = http://15.206.81.210:8081/repository/npm-group-all/
_auth=ZGVwbG95LXVzZXI6ZGVwbG95LXVzZXIxMjM=Code language: JavaScript (javascript)Step 6 – Modify package.json file with group repo name to download
{
  "name": "devopsschool",
  "version": "1.0.0",
  "description": "This is devopsschool npm project",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "author": "Rajesh Kumar",
  "license": "ISC",
  "dependencies": {
    "express": "^4.17.1"
  },
  "publishConfig": {
    "registry": "http://15.206.81.210:8081/repository/npm-hosted-all/"
  }
}Code language: JSON / JSON with Comments (json)Step 7 – Do npm publish
$ npm publishReference
- https://github.com/devopsschool-demo-labs-projects/npm-nexus-hello-world







Iโm a DevOps/SRE/DevSecOps/Cloud Expert passionate about sharing knowledge and experiences. I have worked at Cotocus. I share tech blog at DevOps School, travel stories at Holiday Landmark, stock market tips at Stocks Mantra, health and fitness guidance at My Medic Plus, product reviews at TrueReviewNow , and SEO strategies at Wizbrand.
Do you want to learn Quantum Computing?
Please find my social handles as below;
Rajesh Kumar Personal Website
Rajesh Kumar at YOUTUBE
Rajesh Kumar at INSTAGRAM
Rajesh Kumar at X
Rajesh Kumar at FACEBOOK
Rajesh Kumar at LINKEDIN
Rajesh Kumar at WIZBRAND
 
