npm login error "Public registration is not allowed"? - npm

When I run npm login I got the 403 error "Public registration is not allowed", but this is my package, I can login from the web page https://www.npmjs.com, so what could be the reason?
npm ERR! code E403
npm ERR! 403 403 Forbidden - PUT https://registry.npmmirror.com/-/user/org.couchdb.user:qiulang2000 -
[FORBIDDEN] Public registration is not allowed

I figure that out because I used npm mirror https://registry.npm.taobao.org/,
% npm login
npm notice Log in on https://registry.npm.taobao.org/
Username: qiulang2000
Password:
Email: (this IS public) xxxxx
npm notice
npm notice New minor version of npm available! 8.5.0 -> 8.15.1
npm notice Changelog: https://github.com/npm/cli/releases/tag/v8.15.1
npm notice Run npm install -g npm#8.15.1 to update!
npm notice
npm ERR! code E403
npm ERR! 403 403 Forbidden - PUT https://registry.npmmirror.com/-
/user/org.couchdb.user:qiulang2000 - [FORBIDDEN] Public registration is not allowed
After I changed it back to npm config set registry https://registry.npmjs.org/ I can npm login

Related

Unable to publish npm package

Could anyone tell me how to resolve this error because whenever I run the command npm login it takes me to the login page on the browser after that when I run the npm publish command it gives me the following error
I tried on the web but did not get a possible solution
npm notice Publishing to https://registry.npmjs.org/ with tag latest and default access
npm ERR! code E403
npm ERR! 403 403 Forbidden - PUT https://registry.npmjs.org/show-my-name - You do not have permission to publish "show-my-name". Are you logged in as the correct user?
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! C:\Users\BiM\AppData\Local\npm-cache_logs\2023-02-10T06_08_58_641Z-debug-0.log

How to use FontAwesome

I've got an .npmrc file set up globally for all of my projects with the following contents:
#fortawesome:registry=https://npm.fontawesome.com/
//npm.fontawesome.com/:_authToken=********-****-****-****-***********
When I run npm install --save #fortawesome/fontawesome-pro via FontAwesome Docs, I receive the following error message:
npm ERR! code E401
npm ERR! Incorrect or missing password.
npm ERR! If you were trying to login, change your password, create an
npm ERR! authentication token or enable two-factor authentication then
npm ERR! that means you likely typed your password in incorrectly.
npm ERR! Please try again, or recover your password at:
npm ERR! https://www.npmjs.com/forgot
npm ERR!
npm ERR! If you were doing some other operation then your saved credentials are
npm ERR! probably out of date. To correct this please try logging in again with:
npm ERR! npm login
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Ryan_\AppData\Local\npm-cache\_logs\2022-03-03T23_34_32_319Z-debug-0.log
This message gives the impression that I'm logged out of npm or have outdated credentials, but I've updated the password and logged back in to find the same error present.
running npm whoami returns my username as expected.
FontAwesome support has run me through several troubleshooting steps to no avail. Has anyone experienced this issue? Thanks in advance.

Npm install does not installs secure package though i do npm login followed by npm install commands

Even after logged in using npm login command successfully i get the below error
npm whoami
npm ERR! code E401
npm ERR! 401 Unauthorized - GET https://registry.npmjs.org/-/whoami
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/bharathkumar/.npm/_logs/2021-09-09T08_42_29_365Z-debug.log
Try removing contents/remove file .npmrc in the project folder or the user's home folder

npm ERR! code E401 Incorrect or missing password.If you were trying to login, change your password, create an authentication token

Before Trying tis on My new M1 Macbook Air i tried it on Old MacBook and it works seamlessly on older machine like a charm
My
package.json
{
"name": "root",
"private": true,
"devDependencies": {
"lerna": "^3.20.2"
}
}
Steps i followed
1.
npm config set registry "https://npm.pkg.github.com/ABC"
npm login --scope=#ABC --registry=https://npm.pkg.github.com
username: gitusername
Password: PersonalAccessToken
Email: MyEmail#Organization.com
Logged in as gitusername on https://npm.pkg.github.com/.
3.
npm install -g lerna typescript npm-check-updates
Facing this issue as
npm ERR! code E401
npm ERR! Incorrect or missing password.
npm ERR! If you were trying to login, change your password, create an
npm ERR! authentication token or enable two-factor authentication then
npm ERR! that means you likely typed your password in incorrectly.
npm ERR! Please try again, or recover your password at: npm ERR!
https://www.npmjs.com/forgot
npm ERR! npm ERR! If you were doing some other operation then your saved credentials are
npm ERR! probably out of date. To correct this please try logging in again with:
npm ERR! npm login
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/gajanan/.npm/_logs/2021-04-02T05_22_22_130Z-debug.log
PS :ALL THE COMMANDS WORKS ON MY OLD MACBOOK AIR
I struggle with this problem for a very long time, read all the related answers, but there is no clarity.

Unable to publish npm package from Github?

I've published react-push-notify by using this command :
npm login
npm publish
But when I want to publish again through Github ( private repository ) by following these steps:
Add publishPackage to my package.json
"publishConfig": { "registry": "https://npm.pkg.github.com/" }
Authenticate
npm login --registry=https://npm.pkg.github.com/
Publish
npm publish
It invokes this error:
npm ERR! code E404
npm ERR! 404 Not Found - PUT https://npm.pkg.github.com/react-push-notify
npm ERR! 404
npm ERR! 404 'react-push-notify#0.2.0' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.
This is my first package on npm and I'm confusing what's difference between publishing to npm and publishing to npm from Github?
Login & Logout
npm login --scope=#[Organization name] --registry=https://npm.pkg.github.com
npm logout --scope=#My-Organization --registry=https://npm.pkg.github.com
Publish
npm publish