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
andnpm 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"
}
}