1. Download the Nexus

The Nexus download website address www.sonatype.com/products/re…

I downloaded the nexus-3.30.1-01-Mac.tgz package

2. The Nexus of installation

2.1 Decompressing the installation package

MAC OS environment

The nexus – 3.30.1-01 – MAC. TGZ package into the nexus folder (I unpack to/Users/slatte/Library/nexus)

$tar - ZXVF nexus - 3.30.1-01 - MAC..tgz/Users/szewec/Library/nexusCopy the code

There are two folders nexus-3.30.1-01 and Sonatype -work

2.2 Creating a Soft Link

Create nexus-latest soft link for future updates. Just change the nexus-latest pointer

$ln -s/Users/slatte/Library/nexus/nexus - 3.30.1-01 / Users/slatte/Library/nexus/nexus - latestCopy the code

2.3 Adding System Environment Variables

$ vi ~/.profile
Copy the code

Add the NEXUS_HOME variable

export NEXUS_HOME=/Users/slatte/Library/nexus/nexus-latest
PATH=$PATH:$NEXUS_HOME/bin
Copy the code

Make configuration file changes take effect

$ source ~/.profile
Copy the code

3. Start the Nexus

Start the Nexus service

$ nexus start
Copy the code

Visit the Nexus home page at http://localhost:8081/

4. Release the NPM package to Nexus

4.1 Creating the Hosted Repository

4.2 Creating a Proxy Repository

4.3 Creating a Group Warehouse

4.4 add Realm

Added NPM Bearer Token realms

4.4 Logging In to the NPM Private Vault

npm login --registry=http://localhost:8081/repository/npm-private/
Copy the code

4.5 Running the NPM publish command

npm publish
Copy the code