Receiving an error while trying to install packages from the NPM registry due to non

I am facing some challenges while attempting to install my Ionic App through the registry along with its dependencies. I have been using npm i --loglevel verbose command, and my ~/.npmrc file is configured as follows:

//nexus.OMMITED.com/repository/:_auth=OMMITED
registry=http://nexus.OMMITED.com/repository/npm-all
always-auth=true

Initially, everything seems to be progressing smoothly until we encounter non-registry dependencies. At that point, an authorization error halts the process.

You can view a detailed log of the command here:

The issue arises specifically with

@angular/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="137b67676353253d223d21">[email protected]</a>
in this case, although it could vary between different @angular or @ionic-native dependencies.

Here's what I have attempted so far...

  1. Switching always-auth value between true and false
  2. Executing commands as Super User
  3. Experimenting with different tokens
  4. Using _authToken instead of _auth
  5. Extensively searching online for solutions, only to discover my problem is quite unique
  6. npm login --registry=http://nexus.OMMITED.com/repository/npm-all
    with both --auth=TOKEN_OMITTED and --authToken=TOKEN_OMITTED. However, npm issues a warning stating
    npm WARN invalid config auth-type="TOKEN_OMITTED"
    and then requests a username. My username happens to be an email address, causing the error
    npm WARN Name may not contain non-url-safe chars
    and leading to endless prompts for another username.

Answer №1

It's a mystery to me, but somehow it now functions when I specify the full registry in the command like so:

npm --registry=http://nexus.EXAMPLE.com/repository/npm-all/ install

Even though my ~/.npmrc is set up as follows:

//nexus.OMITTED.com/repository/:_authToken=OMITTED
registry=http://nexus.EXAMPLE.com/repository/npm-all/
_auth=OMITTED
<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="60050d01090c5d020f02202f2d2e2a2829303b21292e09232b292a">[email protected]</a>

It doesn't make any sense to me at all, but I'm grateful that it's working differently now.

If someone can provide an explanation for why this method is effective, how it works, and why the traditional approach fails, I will be happy to acknowledge it as the solution and award the bounty.

Answer №2

To successfully login with Nexus Repo 3 using npm, you can follow this guide:

Ensure that the npm bearer token realm is enabled by navigating to "security/realms" in the Nexus UI.

Despite the error message being 403 and not 401, it indicates a permissions issue leading to rejection. To troubleshoot, examine the nexus request.log to confirm if the 403 errors originate from Nexus or your http proxy server. If they are from Nexus, it suggests that the user has been authenticated but lacks the necessary permissions to access the repository for downloads.

Answer №3

For a solution, consider trying this command once you have updated the .npmrc file: npm run npm-auth

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

What is the best approach to execute this function repeatedly at specific intervals?

I'm attempting to execute everything inside the checkUser() function, but it's not running at the specified interval. Is there a more efficient way to achieve this? My goal is to verify the address every few minutes. The line const accounts = awa ...

Key in the calculation on Keypup for multiple rows, one row at a time

I want to create a calculation function for a form with multiple rows. The goal is to determine the totals for each row by multiplying the cost and unit price, then inputting the result in the total field. Below is the script that I attempted: <scrip ...

Indentation differences between PHP and JavaScript

It's interesting to observe the different indentation conventions in various programming languages. Recently, I came across a code snippet from the PHP manual that caught my attention: switch ($i) { case "apple": echo "i is apple"; ...

Utilize JavaScript/jQuery to check for upcoming deadlines in a SharePoint 2013 list

I need to check if an item is due based on its date. When a user creates an item with a date in the format MM/DD (e.g., 06/15), I want to determine if that date falls within the next 30 days, turning it red, within the next 60 days, turning it orange, or g ...

Is it possible to reduce dependencies on Symfony and Assetic? How can I adjust permissions for node_modules to avoid using sudo?

Currently, I am facing an issue while trying to properly install and run Less with Symfony and Assetic on Ubuntu 12.04 LTS due to a permissions problem. My main question is how can I adjust the permissions so that running app/console assetic:dump does not ...

Focusing on a specific image using Jquery

I am looking to specifically target the image within the "hero1project3" class, however, the image is currently set as a background. Is there a way in jQuery to apply effects like blur only to the image itself, for example, using ".hero1project3 img"? HTM ...

What is preventing ColladaLoader.js in Three.js from loading my file?

Recently, I decided to experiment with three.js and wanted to load a .dae file called Raptor.dae that I obtained from Ark Survival Evolved. Despite having some web development knowledge, I encountered an issue when trying to display this particular file in ...

CRUD operation: The DELETE method is invoked prior to the user's request

Upon opening the localhost:4200 app, I noticed an old delete request already present. Even when I try to use the new delete request by clicking the button, it gives me a 404 (Not Found) error. However, manually entering the URL into the search bar does del ...

The timepicker is set to increment by 30-minute intervals, however, I would like the last time option to be 11:

I am currently using a timepicker plugin and am trying to set the last available time option to be 11:59pm. Despite setting the maxTime attribute in my code, the output does not reflect this change. Any suggestions on how to achieve this would be highly ap ...

Deliver search findings that are determined by matching criteria, rather than by identification numbers

I am seeking to return a JSON match upon form submission, rather than simply searching for a specific ID. However, I am uncertain about how to structure this. I have the ability to search for the necessary match in a JavaScript document within one of my n ...

Testing for connected components with a specific property (React/Redux)

Having a React component with Redux @connect decorator, a situation arises like this: import React, { Component } from 'react' import { connect } from 'react-redux' @connect(mapStateToProps, { onPress: () => {...code}) // The ...

Any recommendations for building HTML in an iOS UIWebView?

When using a UIWeb view, how can I create HTML content? For example, I have some header html code. Then, I would like to include a JavaScript script and pass data to it. Once the JavaScript is injected, I want to add the remaining HTML content from a .html ...

Learn how to implement a captivating animation with JavaScript by utilizing the powerful Raphael Library. Unleash the animation by triggering it with either

My desire is to indicate this movement by triggering a mouse click or drag to the desired location. let myDrawing = Raphael(10,10,400,400); let myCircle = myDrawing.circle(200,200,15); myCircle.attr({fill:'blue', stroke:'red'}); let my ...

Mastering the onKeyPress event for Material UI text fields: A step-by-step guide

I have a TextField component from Material UI as shown below: <TextField id="todo-textarea" label="Enter new todo" placeholder="ToDo" onChange={this.props.toDoOnChange} onKeyPress={(ev) => { ...

Reversing a Firebase list in Angular 2 after inserting a new item: A step-by-step

I am currently looking for a solution to reverse my Firebase list in real-time. For instance: Let's say I have the following Firebase list: {apple, orange, banana}; == After reversing => {banana, orange, apple} If I were to add a new item (with ...

Error: This Service Worker is restricted to secure origins only due to a DOMException

Having trouble implementing this on my website; it keeps showing the following error. Help, please! Service Worker Error DOMException: Only secure origins are allowed. if ('serviceWorker' in navigator && 'PushManager' in wind ...

"Reacting to click events, all buttons have been successfully updated in ReactJS

When a button is clicked, all buttons are updated simultaneously. However, I am looking to only change the state of the specific button that is clicked. Please refer to the image links and code provided below. import React from 'react'; import & ...

Complete circular gauge in Ionic

Encountering an issue when attempting to incorporate a complete circle Gauge/Gage in Ionic, as the gauge fails to display. Has anyone managed to successfully include a full circle Gauge in Ionic similar to this: Came across a GitHub repository that offer ...

What is the best method for arranging components?

I have a Product component that contains crucial information about various products. Adjacent to this data, there is a separate component called Buttons, which includes two buttons - one for adding the product to a favorites list and another for adding it ...

Encountering error while attempting POST request in POSTMAN - "Unable to modify in restricted editor."

I'm facing a bit of a dilemma here. I can't seem to figure out how to make my editor in Postman stop being read-only. Can anyone lend a hand? Whenever I try to send a Post Request, my editor just won't cooperate and stays in Read-Only mode. ...