What is the process for publishing an npm package to a Nexus group repository?

After installing Nexus Repository Manager OSS version 3.2.1, I successfully ran it on my local machine.

Setup

Within Nexus, I have set up three NPM repositories:

  • [PUBLIC] - acting as a proxy for the public npm registry
  • [PRIVATE] - designated for my own packages and as a private repository
  • [NPM] - a group repository that grants access to [PRIVATE] and [PUBLIC] in that specific order

In the Settings/Security/Realms section, I made sure to add npm Bearer Token Realm for security purposes.

Downloading Packages

Downloading packages from [PUBLIC] repository is functioning smoothly as intended.

.npmrc 
registry=http://localhost:8081/repository/PUBLIC
npm install react // Successfully downloading from [PUBLIC]

I can also download packages from the [NPM] repository without any issues.

.npmrc 
registry=http://localhost:8081/repository/NPM
npm install react // Works fine, downloads from [PUBLIC]

However, I encountered a problem with the [PRIVATE] repository as I do not have a package named "react" in it.

Publishing Packages

When it comes to publishing, I prefer not to publish to [PUBLIC] repository.

I have successfully published packages to the [PRIVATE] repository.

.npmrc 
registry=http://localhost:8081/repository/PRIVATE
npm publish // Successfully publishes to [PRIVATE]

Interestingly, I am unable to publish packages to the [NPM] repository which seems unusual.

.npmrc 
registry=http://localhost:8081/repository/NPM
npm publish // Fails to publish, should go to [PRIVATE] instead
// Returns HTTP 400 error

Error Details

For a detailed log of the error, refer to: https://pastebin.com/5GuqNNhf

Issue

While I am aware that I can configure a different URL for publishing packages using 'publishConfig' in the package.json file, it feels redundant to me in terms of configuration.

Is there a way to achieve this using the Nexus group repository?

Answer №1

If you're trying to publish to a group repository, it won't work. You need to switch to using the URL of a hosted npm repository for it to be successful.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Unable to locate template or render function for Vue Draggable Next component

Looking to incorporate Vue Draggable Next into a Vue 3 example page but encountering some challenges. I've attempted to follow the instructions in the repository. However, I ran into issues when importing the Vue Draggable Next component and had to re ...

Shutting down browser with WebdriverIO and launching a new one

I am facing a challenge in my application testing process. I need to simulate a scenario where I close the browser and session, then open a new browser and session to check if the previously entered data can be successfully recalled by passing certain laun ...

Tips for organizing an API response based on a specific field

I'm currently in the process of learning Reactjs and I've hit a roadblock with a specific question. I have successfully fetched data using axios from an API endpoint (such as countries with details like population, currencies, region, etc.) and n ...

Can someone provide guidance on how to validate a HEX color in Cypress?

As I dive into testing with Cypress, my lack of experience has become apparent. I am trying to test the background-color CSS property on a specific element, but running into an issue - everything is in RGB format behind the scenes, while I need to work wit ...

Displaying a message in a modal popup once an existing modal popup has been closed - Angular

Hello, I am new to using Angular and I have a question. How can I show a success message in another popup after sending an email from a modal popup? Here is a snippet of my code: <div id="modalViewImportCode" class="modal fade btm-border" role="dialog" ...

Guide to capturing mouse drag coordinates using JavaScript within a JSP page

My task is to record the starting coordinates (x,y) and ending coordinates (x,y) of a mouse event. For example, on an HTML page with an image, users should be able to select a specific area by dragging the mouse. Therefore, I need to capture the coordinat ...

I am wondering how to use the value assigned to a variable's textContent as an argument for player input in my JavaScript code

i am currently developing a JavaScript project to create a user interface for my rock, paper, scissors game. Currently, the game only runs in the console and prompts the player for input. So far, I have implemented three buttons (one each for rock, paper, ...

Traverse Through Nested JSON Data and Display it in an HTML Table using Vue

Struggling to find a way to loop through my data, I have JSON data presented like this: [ { "STATUS":"CUTTING INHOUSE", "STID":"1", "CATS":[ { "CAT":"ORIGINALS ", "ARTS":[ { "ARTNO":"GY8252", ...

Asynchronously retrieve the result from a previous NodeJS chain and forward it to a nested function for processing

When uploading an image from the client as Base64 to the server, I need to: Save the file to disk Get the result of the save (first chain) and pass it to the next chain Check the result in the next function using that(), if it's true, update the dat ...

What is the best way to set up multiple routes for a single component in React

I am currently using Vue 2 in my project and have set up the following routes: const routes = [ { path: "/suites", component: Home, }, { path: "*", component: LandingPage, }, ]; Now, I need to include an additi ...

Verify if there are DOM elements located within a DIV container, execute the functions associated with those elements sequentially

I am in the process of creating a game using HTML, CSS, and JavaScript. My focus right now is on manipulating DOM elements without relying on the canvas tag. The goal is to develop a pseudo graphical programming language, similar to the environment provide ...

Sending information from the backend to the frontend using Node.js and Express

I am seeking advice on the most effective method for achieving a specific task. In my Node.Js / Express application, there is a point where I need to send data to the backend and receive a certain value back to the front end. Typically, this can be accomp ...

Transitioning from mui version 4 to version 5 leads to an error message: "TypeError: Cannot access 'keyboardDate' properties of undefined"

After updating from MUI v4 to version v5, I encountered failing tests with the following error: TypeError: Cannot read properties of undefined (reading 'keyboardDate') 17 | it("should render correctly without any errors", () =& ...

Are you using yeoman with csslint in your project?

As a newcomer to grunt, I am facing challenges in integrating csslint to monitor my project while running "grunt serve" for csslinting. I am specifically struggling with disabling the adjoining classes warning since it is not relevant for IE6 compatibili ...

Unable to access the following element using jQuery's next() method

Can someone help me understand how the "next" function works in jQuery? I'm trying to reveal a hidden textarea when a span element is clicked. The hidden textarea is supposed to be the immediate next sibling of the span, but it's not working as e ...

Retrieve the JSON data from the server's response

{"identifier":"2231f87c-a62c-4c2c-8f5d-b76d11942301"} After alerting the response data, I discovered the code snippet shown above. Now, how can I retrieve the value of the identifier? The controller is set up to return like this: return Json( new { ...

conceal the "load more" option when no additional content is available for loading

I recently incorporated a "load more" button using the plugin called "easy load more" (https://wordpress.org/plugins/easy-load-more/). While the button is functioning well, it continues to appear even when there are no more posts to display. I am seeking s ...

Do only the imported functions in a React App contribute to the overall size and overhead for the user?

For instance, my React application relies on the MUI package. However, I am only utilizing the Slider and AutoComplete components from the package. Do only these 2 components impact the performance of my application for the end user? Or does the entire p ...

Launch a PowerPoint presentation in a separate tab on your web browser

If you have a link that leads to a .pdf file, it will open in a new tab like this: <a target="_blank" href="http://somePDF.pdf">Download</a> But what about a Powerpoint file, such as a .ppt? Is there a way to make it open in a new browser tab ...

Connect the private repository within the packages.json file of the app that has been deployed to Google Cloud

I'm in the process of setting up Continuous Deployment for my node.js app (my-app). The code is stored on Bitbucket and I'm utilizing Bitbucket's Pipelines for deployment to Google Cloud Platform, specifically App Engine. The issue arises w ...