Showing posts with label Packages. Show all posts
Showing posts with label Packages. Show all posts

April 29, 2022

Publish and Consume NPM Packages using GitHub Package Manager

 Hi folks,

We are used to publishing the npm packages on npmjs.com. Today, I will show how we can publish the npm packages to GitHub and the steps to use those packages.

1. Publishing Packages

Prerequisites

We need to have an account with GitHub

JavaScript native/framework based project with package.json

Add the .npmrc file to your project with the following syntax. Change the OWNER value to your GitHub account or organization name.

@OWNER:registry=https://npm.pkg.github.com

Publishing Process to GitHub

Create personal access token using the following steps

  • Login to GitHub
  • Go to Settings
  • Navigate to "Developer Settings" -> "personal access tokens"
  • Generate token with write:packages access permissions

  • Open terminal in the project folder
  • Execute the command to login
  • npm login --scope=@OWNER --registry=https://npm.pkg.github.com
  • When prompted,
    • Username: GitHub username
    • Password: Personal access token
    • Public e-mail: Your email address
  • Enter the following command to publish the package
  • npm publish

2. Consume/Installing the packages

Prerequisites

We need to have an account with GitHub

Installation

Add the .npmrc file to your project with the following syntax. Change the OWNER value to your GitHub author or organization name.

@OWNER:registry=https://npm.pkg.github.com

Enter the full name @OWNER/package-name-version in dependencies in package.json
Install the dependencies
npm install

Note: If the organization is asking for authorization of personal access token, then you need to authorize from the personal access token section against the token for the respective organization.

Hope you will make use of GitHub for publishing the packages and consuming them with ease.

Request you to send your feedback and comments to psrdotcom@gmail.com

February 02, 2022

Ubuntu - update NPM and NodeJS

Hi folks,

Some people often confuses with NPM update vs Node.js update.

Let me clarify that, NPM (Node Package Manager) is a CLI (Command Line Interface) to manage the JS (JavaScript) packages from https://www.npmjs.com/ or any other external package managers like GitHub.

Node.js is a FrontEnd JavaScript Framework like Vue.js, AngularJS which helps to build the scalable network applications. Node.js® is a JavaScript runtime built on Chrome's V8 JavaScript engine.

NVM (Node Version Manager) and n are command line utilities to manage and switch between Node.js versions.

When you are installed for the first time, you will be installing Node.js from https://nodejs.org/en/download/ which also installs NPM CLI utility.


But when upgrading the NPM or Node.js, it's a different story.


Update NPM

npm install -g npm

Update Node.js with Node version manager (n)

Install the n

sudo npm install -g n

Update the Node.js to stable version

sudo n stable

As of now, the stable version is 16.3.2 which includes NPM 8.1.2

Update the Node.js to current version

sudo n current

As of now, the current version is 17.4.0 with NPM 8.3.1


Check the versions

NPM

npm --version

Node.js

node --version


Hope this helps you to understand the NPM and Node.js difference along with update of individual components.

Send your comments and feedback to psrdotcom@gmail.com

 

November 20, 2018

Completely uninstall openjdk in RedHat Enterprise Linux (RHEL)

Hi all,

Today, I'll explain how to uninstall completely the openjdk from the RedHat Enterprise Linux (RHEL) machine.

Some of the softwares requires only the Oracle Java and having the openjdk, sometimes causes an issue. So, some users wants to remove the openjdk from the linux machine.

Pre-requisites


  • openjdk installed on the machine
  • Check for java alternatives, when multiple java versions installed
  • #> /usr/sbin/alternatives --config java
  • Result with + is the currently selected java for the machine


Procedure


1. Find out the installed openjdk versions

#> rpm -qa | grep java
#> rpm -qa | grep jdk

Sample Output:

java-1.8.0-openjdk-1.8.0.191.b12-1.el7_6.x86_64
java-1.8.0-openjdk-headless-1.8.0.191.b12-1.el7_6.x86_64


2. Remove the all openjdk versions

#> yum remove <>

Example:
#> yum remove java-1.8.0-openjdk-1.8.0.191.b12-1.el7_6.x86_64
#> yum remove java-1.8.0-openjdk-headless-1.8.0.191.b12-1.el7_6.x86_64

Hope, it is useful for you to configure java on your linux machine.

Please send your feedback and comments to psrdotcom@gmail.com

March 02, 2017

Oracel Database: Delete all user objects (Tables, Views, Procedures, Functions, Sequences, Types, Packages)

Hi friends,

I have come across a situation, where I need to delete all the user objects i.e. Tables, Views, Procedures, Functions, Sequences, Types, Packages.

Please find the link below for the SQL script, which does the job for you.

It's my public GitHubGist URL, where anyone can share the code snippets.

https://gist.github.com/psrdotcom/b61f8b401d4992428ecd8fb8225436c4

Advantage:
You can delete the user after deleting all user objects by logging into SYSTEM user.

Please send your review and feedback to psrdotcom@gmail.com


Featured Post

Java Introdcution

Please send your review and feedback to psrdotcom@gmail.com