Issue with Publishing NPM Package (org.couchdb.user:USERNAME' is not in the npm registry) - npm

Issue:
I'm trying to publish my npm package https://www.npmjs.com/package/react-native-ultimate-modal-picker and it's coming up with the error. It's been 9 months since I last have made a publish and I just updated a ton of code and files. I also set the publishing from NPM to GitHub, but I think I reverted those changes?
Question:
Why am I getting the errors below?
How can I make sure that the npm package is published to https://www.npmjs.com/package/react-native-ultimate-modal-picker?
Errors:
org.couchdb.user:jefelewis' is not in the npm registry.
This package name is not valid, because
npm ERR! 404 1. name can only contain URL-friendly characters
npm ERR! code ENEEDAUTH
npm ERR! need auth This command requires you to be logged in.
npm ERR! need auth You need to authorize this machine using `npm adduser`
Process:
npm login
Enter login info (Username: jefelewis)
org.couchdb.user:jefelewis is not in the npm registry.
The issue is that my username is jefelewis (https://www.npmjs.com/~jefelewis)

Update:
This was fixed by using npm config set registry https://registry.npmjs.org/ in the terminal

Related

Package release issue

npm notice Publishing to https://registry.npmjs.org/
npm ERR! code E403
npm ERR! 403 403 Forbidden - PUT https://registry.npmjs.org/demo-package - You do not have permission to publish "demo-package". 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! /home/kaleesha/.npm/_logs/2023-01-23T21_12_42_133Z-debug-0.log
I try these steps,
npm init
npm login
npm publish
I have npm account and I logged into it before published the package
demo-package is a package that already exists on npmjs here. If you are not the user that initially published this package 8 years ago or the user enabled you as a coauthor, you are not allowed to write to it since you are not the owner.
Be aware that npm Packages can not be removed once published on npmjs. There is a very short window to unpublish it. After that, it's not deletable.
If you want to test publishing packages you can try local registries like Verdaccio.

Publish npm package to gitlab registry

I am trying to publish a package to a private Gitlab npm registry. I am following gitlab's docs on how to do this, but something isn't working right.
First, I created a personal access token with all access. Then, in my terminal, as per their docs, I set
npm config set #myproject/my_package http://gitlab.com/api/v4/projects/myproject/my_package/packages/npm/
npm config set -- http://gitlab.com/api/v4/projects/myproject/my_package/packages/npm/:_authToken "<my_token>"
Though there is no output from these commands, so I'm not really sure what its doing or if its working as intended.
Next, in my package.json, I set the name and publishConfig to what you would expect for a scoped package:
{
"name": "#myproject/my_package",
"publishConfig": {
"access": "restricted",
"#myproject/my_package": "https://gitlab.com/af56/myproject/my_package/packages/npm/"
}
}
I then run npm publish. I see that the package is being built, but then I get an error
npm ERR! code ENEEDAUTH
npm ERR! need auth This command requires you to be logged in to https://registry.npmjs.org/npm ERR!
need auth You need to authorize this machine using `npm adduser`
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\me\AppData\Local\npm-cache\_logs\2022-11-09T00_00_38_418Z-debug-0.log
I don't understand why npm is trying to reach npmjs when I configured it to use gitlab as the registery, both through the command line, and in the package.json. I've published packages to npmjs before, but never to gitlab registry, so I'm not sure what steps I'm missing / doing wrong.

How to resolve err code 403 Forbidden in npm install?

I'm trying to run npm install in a public repository. I’ve cloned it to my PC but it throws me this error.
I’ve tried verifying my npm account, and disabling my security/firewalls.
I dont know how to solve it!
$ npm install
npm ERR! code E403
npm ERR! 403 403 Forbidden - GET <url>
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\...
Nothing to worry about.
Probably, there is a security policy for different libraries (in case it is corporate project).
In this case you need to investigate your issue to someone in your company.
Another case can be with package-lock.json
Just open lock file and try to find something similar to received URL.
Try to delete lock file and after that run npm install
I had a similar error and here is what helped me:
npm config set registry https://registry.npmjs.org/
It sets the npm registry to default. More info here: https://docs.npmjs.com/cli/v8/using-npm/registry
Run this to check your current registry value:
npm config list
If a change of the registry doesn't help, you can check what npm username is in use by running:
npm whoami
If it is not the one that has related permissions for the package to be installed then log in with related credentials by running:
npm login

Published a NPM package to Azure Artifacts but getting this error while installing

F:\angular library\sampleangular>npm install examplepackage#0.0.1
npm ERR! code E404
npm ERR! 404 Not Found - GET https://registry.npmjs.org/examplepackage- Not found
npm ERR! 404
npm ERR! 404 'examplepackage#0.0.1' 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.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\jack\AppData\Roaming\npm-cache_logs\2020-03-03T06_07_13_338Z-debug.log
We have the same error (E404). The root cause turned out, is because we have multiple registry sources. One is our own registry and the other is public registry (registry.npmjs.org)
To resolve this, we added both registries in the .npmrc file (can be in either user's .npmrc or the project .npmrc).
We append the following lines in the .npmrc file.
#contosoPrivateFeed:registry=https://contoso.pkgs.visualstudio.com/_packaging/Contoso.Feed/npm/registry/
registry=https://registry.npmjs.org
Also worth to mention, we don't have Upstream setup in our Azure DevOps feed.
Specifying multiple registries allow npm commands to use the registries. Thus, no need to setup Upstream sources.
After some tests, we think your issue may be related to the UpStream source in Azure devops feed settings.
Here's some info when I do the test:
nest is package from default npm packages. When i deleted the npm upstream source, I got the same error when running command npm install nest. After that I added the NPM public source(npmjs) as one upstream sources in feed settings, then it worked when I ran the command the second time.
So you need to add npmjs as Upstream source of your current feed. Hope it helps :)

npm install host key verification failed

I ran npm install in angular2+ project directory and got below error which I cannot understand at all.
npm ERR! Error while executing:
npm ERR! C:\Program Files\Git\bin\git.EXE ls-remote -h -t ssh://git#bitbucket.org/path/projectname.git
npm ERR!
npm ERR! Host key verification failed.
npm ERR! fatal: Could not read from remote repository.
npm ERR!
npm ERR! Please make sure you have the correct access rights
npm ERR! and the repository exists.
npm ERR!
npm ERR! exited with error code: 128
I have created ssh key on bitbucket and account and saved it on drive. |
I have clone project from bitbucket.
What does this error has to do with that?
As I am new on project so don't have much knowledge.
Do I need to provide ssh key while npm install as well?
Please let me know if I can provide more info related to question.
Thanks!
Please check the npm version that you are using. Npm comes bundled with node and you shouldn't have multiple instances on your classpath.
Hey yup, I thought as much, but seeing as I had updated npm to the
latest version ( I even uninstalled node and reinstalled ) with the
same result. npm -v still showed the same version - 1.4.9.
FYI for others that may have the same issue. I also have Chocolatey
installed, and it seems that npm was also installed via Chocolately
which seems to overide the npm path. Uninstalling npm from Chocolately
resolved the npm version issue.
After that angular/cli installs correctly from npm.
https://github.com/angular/angular-cli/issues/6313#issuecomment-301360623