Encountering a problem while trying to run npm publish with public access, error code E

I've encountered an issue when attempting to publish a scoped package on npm, where I consistently receive this error via the CLI:

npm ERR! code E403
npm ERR! 403 403 Forbidden - PUT https://registry.npmjs.org/@username%2fdynamic-ui-elements - Forbidden
npm ERR! 403 In most cases, you or one of your dependencies are requesting
npm ERR! 403 a package version that is forbidden by your security policy, or
npm ERR! 403 on a server you do not have access to.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/cutler/.npm/_logs/2022-05-16T23_08_36_735Z-debug.log

Despite diligently searching numerous sources online to resolve the issue, none of the proposed solutions seem to work.

  • I have successfully logged in through the CLI
  • My npm email address has been verified
  • There are no conflicting packages with the same name since I am publishing under my username, and I have never published any other packages
  • I've attempted the command as npm publish --access public and npm publish --access=public
  • Two-factor authentication (2FA) has been enabled

Regarding 2FA, I've experimented with both enabling and disabling the "Require two-factor authentication for write actions" option. When it's enabled, instead of the previous error, I am prompted for a one-time password. However, even after inputting the code generated by my Google Authenticator app, I still encounter the E403 error.

These two queries echo my own struggles, yet no concrete answers have been provided. Am I mishandling the authenticator? Is there a specific setting I'm overlooking?

Here is my package.json:

{
    "name": "@username/dynamic-ui-elements",
    "version": "1.0.0",
    "description": "Some dynamic UI elements to transform your HTML",
    "main": "index.js",
    "scripts": {
        "test": "echo \"Error: no test specified\" && exit 1",
        "build": "webpack",
        "start": "webpack serve --open"
    },
    "repository": {
        "type": "git",
        "url": "git+https://github.com/CutlerSheridan/dynamic-ui-elements.git"
    },
    "author": "Cutler Sheridan <<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="95f6e0e1f9f0e7bbe6fdf0e7fcf1f4fbd5f2f8f4fcf9bbf6faf8">[email protected]</a>>",
    "license": "ISC",
    "files": [
        "src/dynamicUi.js",
        "README.md"
    ],
    "bugs": {
        "url": "https://github.com/CutlerSheridan/dynamic-ui-elements/issues"
    },
    "homepage": "https://github.com/CutlerSheridan/dynamic-ui-elements#readme",
    "devDependencies": {
        "webpack": "^5.72.1",
        "webpack-cli": "^4.9.2",
        "webpack-dev-server": "^4.9.0"
    }
}

Answer №1

After going through the package.json file numerous times, I realized my mistake lay in not updating the pre-set

"name": "@username/dynamic-ui-elements"
to reflect my actual username.

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

You cannot reassign NodeJS global variables

Currently, I am in the process of writing unit tests for code that utilizes a JavaScript library. This particular library sets a global variable if it does not already exist using the following pattern: var GLOBAL_VAR = GLOBAL_VAR || {} While this method ...

Combine the text value from a textbox and the value from a checkbox into a single

I'm trying to solve a challenge regarding appending values from text fields (excluding empty ones) and checkboxes in a specific order to form a string. It should be in the format: name|T|F_name|F|F. Once I've created this string, I plan to send i ...

What is preventing me from excluding the implicit parameter in this situation?

Here is how my code looks: def okJsonify[T](data: T)(implicit tjs: Writes[T]): Result = Results.Ok(toJson(data)(tjs)) The definition of toJson can be found in play-json_2.11-2.3.7-sources.jar!/play/api/libs/json/Json.scala def toJson[T](o: T)(implic ...

The epoch time indicates a 12-hour difference

I keep encountering an error with the time showing as 12:00 P.M. When I receive a response in epoch time format 1454092200000, it corresponds to 1/30/2016, 12:00:00 AM GMT+5:30 $scope.shipmentDate = moment(1454092200000).format("YYYY/MM/DD hh:mm"); The ...

The connection was refused by hapi.js

We have recently encountered an issue while using hapijs: hapi, {"code":"ECONNREFUSED","errno":"ECONNREFUSED","syscall":"connect","domainEmitter":{"domain":{"domain":null,"_events":{},"_maxListeners":10,"members":[]},"_events":{},"_maxListeners":10},"doma ...

Combining ApolloProvider and StatsigProvider in ReactJs: A Step-by-Step Guide

Currently in my React (Next.js) application, I am utilizing statsig-react to switch between mastergraphql endpoint URLs. However, I am encountering an issue when trying to connect statsig with Apollo. This is how my app.js file looks like: const apollo = ...

Transforming a JSON data structure into a custom type leads to the creation of empty objects

After making a REST call, the JSON response looks like this: { "livemode": true, "error": { "type": "unauthorized", "message": "You did not provide a valid API key." } } I want to extract the values of type and message into my custom object: ...

Validation is performed on the Bootstrap modal form, ensuring that the modal is only loaded after the

In order to provide a better understanding of my website's file structure, I would like to give an overview. The index.php file dynamically adds many pages to my website. Here is the code from index.php: <?php include ('pages/tillBody.php ...

The internet browser encountered a JavaScript runtime error (0x800a138f) in which it was unable to retrieve property '0' due to it being either undefined or pointing to a

I'm encountering an issue with my javascript/jquery function that retrieves the selected dropdown value. Everything works fine in Chrome, but when I try to run my application in IE, it throws an error. $("#Application_AppCountries").change(function ( ...

AngularJS: Recommendations for structuring code to dynamically update the DOM in response to AJAX requests

Within Angular's documentation, there is a straightforward example provided on their website: function PhoneListCtrl($scope, $http) { $http.get('phones/phones.json').success(function(data) { $scope.phones = data; }); $scope.order ...

Issues with local storage ternary expression in React are causing unexpected behavior

I am attempting to accomplish this task. const userToken = localStorage.getItem('token') {userToken.length ? null : <div className='registerLogin'> Register... </div> } The ternary operator is not working ...

The presence of certain characters is leading to problems in the console

Similar Question: Escaping a String for JavaScript Usage in PHP? The characters in my text are causing errors. When I input special characters such as: !\"$%^&()-=\'.,:;/?#~/\\>< An error saying "Syntax error ...

Navigating a JSON array with Python: A guide to parsing

Here is my JSON array and I need to create a new string based on it. I wrote a simple function to try returning a value from the JSON data, but I encountered an issue with Error was expected string or buffer def blah(myjson): data = json.loads(myjson ...

Transferring information between different parts of a system

I have created a component that includes a state called chosenGenre, along with a function that updates this state based on button clicks. My goal is to access the updated state (which is of type string) in another component. This is the initial componen ...

Transferring custom objects created by users from an Android application to an ASP.NET webservice using JSON

I developed a web service using ASP.NET, which is designed to accept a List of Contact objects. [WebMethod] [ScriptMethod(ResponseFormat = ResponseFormat.Json)] #region List of contacts that need to be created in the database. public List& ...

Guide on crafting a scrollable and touch-responsive grid using CSS and JavaScript

I am seeking guidance on creating a grid with a variable number of columns and rows. It should be contained within a separate div and should not interfere with other objects or alter the parent's size. The grid needs to be square and I am currently u ...

Dilemma of interdependencies between Socket.io and requirejs

I am facing a challenge with my legacy express project that has two servers. The project includes two separate client files: requirejs.config({ baseUrl: '/js' , paths: { "jquery": "lib/jquery/jquery-2.1.1.min", "socket.io" : "lib/socket/ ...

Is there a way to link a particular model table with a designated user table?

Hey everyone, I'm new to stack overflow and this is my first question. I hope it's clear enough for you all to understand. I'm currently working on a budget API using Node.js, Sequelize, Express, and PostgreSQL. The API allows users to add/ ...

I am looking to modify the ID of the select element nested within a td tag

This is the code snippet I am working with: <tr> <td class="demo"> <label>nemo#2 Gender</label> <select id="custG2" required="required"> <option>....</option> <option>M</option> ...

Displaying Title and Description Dynamically on Markers in Angular Google Maps

I am currently utilizing Angular-google-maps, and here is the HTML code snippet: <ui-gmap-google-map center='mapData.map.center' zoom='mapData.map.zoom' events="mapEvents"> <ui-gmap-markers models="mapData.map.markers ...