-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] Can't run npm install
and can't even run npm whoami
without errors using GitHub Packages
#2758
Comments
Downgrading to I still get an error running |
you have your registry specified as this change makes the request to whoami be this working in npm 6 i think is actually a bug in npm 6 where the path is being ignored.. |
I'm running into this same issue after upgrading to v7.5.6 from v6.14.10. GitHub repositories require the owner in the path, ex |
For the login issue, see if this works (https://docs.github.com/en/packages/guides/configuring-npm-for-use-with-github-packages#authenticating-to-github-packages):
|
I know those docs instruct you to append your username, but if you can try without it and let me know what that changes I'd appreciate it. If that works I'll make sure the docs are modified to reflect that |
I needed to add registry command line option to make it work
|
Closing due to age. If this is still a problem please feel free to reopen this issue, or create a new issue w/ steps to reproduce. |
Noting here if anyone had organizational issues after running the above steps. Ensure that your Personal Access token is authorized by your company as well. |
I was able to resolve my issue by changing the syntax in the |
Current Behavior:
If I run these various commands, I get these errors. Everything seemed to be working fine a month ago and often if things broke, I'd typically look towards regenerating a github token and putting that into my
~/.npmrc
file. This started from a few versions ago, around 7.4.3 I believe.My goal is to have this work normally as usual: install public npm packages as you would without any additional configuration, yet be able to access private packages hosted on GitHub packages.
My
.npmrc
file in the project folder is:I regenerated a token in this url on GitHub: https://github.com/settings/tokens/ and I copied and pasted it into
~/.npmrc
with the contents as follows:Not sure why it would consider
whoami
as a package when clearly its a command.Anyway, if I also try to run
npm install
I get a similar issue:If I try to do as suggested, when I try to run
npm login
I get:Not sure why I get an error like this, seeing as I entered my details properly and copied and pasted the token in properly.
Expected Behavior:
Everything should work as intended.
npm whoami
should give a simple result of the username/alias andnpm install
should install packages.Steps To Reproduce:
.npmrc
file locally in a nodejs project with contents:registry=https://npm.pkg.github.com/[MY_GITHUB_USERNAME]
repo, workflow and write:packages
checked~/.npmrc
and paste//npm.pkg.github.com/:_authToken=XXX
npm whoami
npm install
Environment:
The text was updated successfully, but these errors were encountered: