-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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] 7.x - 404 when installing with .npmrc
with github package registry
#1654
Comments
Just to add, here is the output of $ npm config ls -l
; cli configs
long = true
metrics-registry = "https://registry.npmjs.org/"
user-agent = "npm/7.0.0-beta.4 node/14.8.0 linux x64"
; userconfig /home/synapse/.npmrc
@zethcon:registry = "https://npm.pkg.github.com"
; default values
access = null
all = false
allow-same-version = false
also = null
always-auth = false
audit = true
audit-level = null
auth-type = "legacy"
before = null
bin-links = true
browser = null
ca = null
cache = "/home/synapse/.npm"
cache-lock-retries = 10
cache-lock-stale = 60000
cache-lock-wait = 10000
cache-max = null
cache-min = 10
cafile = undefined
call = ""
cert = null
cidr = null
color = true
commit-hooks = true
depth = 0
description = true
dev = false
dry-run = false
editor = "vi"
engine-strict = false
fetch-retries = 2
fetch-retry-factor = 10
fetch-retry-maxtimeout = 60000
fetch-retry-mintimeout = 10000
force = false
format-package-lock = true
fund = true
git = "git"
git-tag-version = true
global = false
global-style = false
globalconfig = "/opt/zethcon/bin/nvm/versions/node/v14.8.0/etc/npmrc"
globalignorefile = "/opt/zethcon/bin/nvm/versions/node/v14.8.0/etc/npmignore"
group = 500
ham-it-up = false
heading = "npm"
https-proxy = null
if-present = false
ignore-prepublish = false
ignore-scripts = false
include = []
include-staged = false
init-author-email = ""
init-author-name = ""
init-author-url = ""
init-license = "ISC"
init-module = "/home/synapse/.npm-init.js"
init-version = "1.0.0"
json = false
key = null
legacy-bundling = false
legacy-peer-deps = false
link = false
local-address = undefined
loglevel = "notice"
logs-max = 10
; long = false (overridden)
maxsockets = 50
message = "%s"
; metrics-registry = null (overridden)
node-options = null
node-version = "14.8.0"
noproxy = null
offline = false
; omit = [] (overridden)
only = null
optional = true
otp = null
package = []
package-lock = true
package-lock-only = false
parseable = false
prefer-offline = false
prefer-online = false
prefix = "/opt/zethcon/bin/nvm/versions/node/v14.8.0"
preid = ""
production = false
progress = true
proxy = null
read-only = false
rebuild-bundle = true
registry = "https://registry.npmjs.org/"
rollback = true
save = true
save-bundle = false
save-dev = false
save-exact = false
save-optional = false
save-prefix = "^"
save-prod = false
scope = ""
script-shell = null
scripts-prepend-node-path = true
searchexclude = null
searchlimit = 20
searchopts = ""
searchstaleness = 900
send-metrics = false
shell = "/bin/bash"
shrinkwrap = true
sign-git-commit = false
sign-git-tag = false
sso-poll-frequency = 500
sso-type = "oauth"
strict-ssl = true
tag = "latest"
tag-version-prefix = "v"
timing = false
tmp = "/tmp"
umask = 2
unicode = true
unsafe-perm = true
update-notifier = true
usage = false
user = 500
; user-agent = "npm/{npm-version} node/{node-version} {platform} {arch} {ci}" (overridden)
userconfig = "/home/synapse/.npmrc"
version = false
versions = false
viewer = "man"
|
hi @nicholas-ochoa I tried to recreate a minimal reproduction of this problem and couldn't get it, I wonder if you can provide more info, like a also cc @leandro-manifesto and @aidant which thumbs up'd the issue and might have some other examples, logfiles to share |
I believe I checked this out with a previous beta version, but trying it out again on Also, I was not using GitHub Packages, but another private registry. |
That's a great point @leandro-manifesto, it would be nice if you can confirm how it behaves with the latest |
I tried again with the I'll take a crack at creating a minimal reproduction repository. |
For private registries containing scoped packages I always set the
But anyway, it seems NPM is looking for the wrong packages in GitHub Packages. |
I've created a couple repos and another gist showing the result. https://github.com/nicholas-ochoa/npm7-issue-test-pkg - Small package with that Gist with Looking at the log output, the scoped package succeeds while the two non-scoped packages are failing because they don't exist on the GitHub package repository. |
I tested here with a clean cache and the problem showed up too. |
sounds great 👍 thank you all for the feedback, and specially @nicholas-ochoa for the reproducible repo, I'll give it another try! |
The `flatOptions.scope` option should not default to `projectScope` since that's causing projects that have a defined `projectScope` corresponding to configured scoped registries to try and download ALL packages (including the ones that should be downloaded from the public registry) to be fetch from that scoped registry url. fix npm#1654
The `flatOptions.scope` option should not default to `projectScope` since that's causing projects that have a defined `projectScope` corresponding to configured scoped registries to try and download ALL packages (including the ones that should be downloaded from the public registry) to be fetch from that scoped registry url. fix #1654 PR-URL: #1758 Credit: @ruyadorno Close: #1758 Reviewed-by: @isaacs
|
awesome to hear @leandro-manifesto 🎉 I'm going to close this one now, let me know if you still have issues @nicholas-ochoa 😊 Thanks for all your help! |
|
Hi, I am facing the same issue while publishing a library.
How to solve this? |
Same issue on my end. Followed that guide: https://docs.github.com/en/actions/quickstart One time, the package was created after all, but got the same 404 error during local
|
facing this issue as well, I am stuck. It was working fine on my previous machine or maybe in those days. @ALL also note github changed something with their tokens, if it has anything to do with that. |
I am facing also, however when i yarn install the packages install fine. It's for a private github package, that has npm packages also as dependencies Update: updating to latest npm resolved for me |
Same issue here. Even upgrading from npm 6.14.10 to latest (8.2.0) does not fix it. Update: I had changed the package name but not the repository url, so the repository url was invalid. The error message is simply confusing with 404. |
Current Behavior:
npm install
with my~/.npmrc
containing the github package registry info for our scoped packages fails with 404 errors for any packages not scoped to our github organization.Expected Behavior:
All packages should download whether it's from github package registry or registry.npmjs.org
Steps To Reproduce:
Add github package registry detail for your organization to your
~/.npmrc
:Run
npm install
:If I remove the github registry from
~/.npmrc
, the install progresses but fails when it encounters our scoped packages:I noticed if a
package-lock.json
is present from a prior npm v6 install everything seems to work as expected with the github registry and all.Environment:
The text was updated successfully, but these errors were encountered: