Closed nicholas-ochoa closed 4 years ago
Just to add, here is the output of npm config ls -l
with the ~/.npmrc
intact:
$ 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 package.json
and package-lock.json
OR ideally if you can help out isolate the problem to a small reproducible git repo/gist OR just find a public project in GitHub where we can easily observe it. That would help out enormously in tracking down the bug. 😊
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 beta.7
seems to be working properly.
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 beta.7
pre-release since we just shipped a major configs refactor there @nicholas-ochoa
I tried again with the beta.7
pre-release and experienced the same issue. I've put the log, console output and package.json
on a gist: https://gist.github.com/nicholas-ochoa/a610be4901e431f4c4ad9728a18c4010 - no package-lock.json is created.
I'll take a crack at creating a minimal reproduction repository.
For private registries containing scoped packages I always set the always-auth
config along with the registry
like so:
@zethcon:registry=https://npm.pkg.github.com
@zethcon:always-auth=true
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 npm7-issue
depends on
https://github.com/nicholas-ochoa/npm7-issue - Minimal reproduction that has a couple non-scoped dependencies (chalk
and uuid
) and a scoped dependency (@nicholas-ochoa/npm7-issue-test-pkg
).
Gist with npm install
output and log file: https://gist.github.com/nicholas-ochoa/87040f9a09e45f4969b5c0da2710f221
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. It seems NPM is ignoring the scope part of the registry configuration and setting it as the global one.
sounds great 👍 thank you all for the feedback, and specially @nicholas-ochoa for the reproducible repo, I'll give it another try!
beta.9
works like a charm.
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!
beta.9
is working for me as well!
Hi, I am facing the same issue while publishing a library.
npm notice
npm ERR! code E404
npm ERR! 404 Not Found - PUT https://npm.pkg.github.com/@tanishka-bansal%2fnpm-practice - The expected resource was not found.
npm ERR! 404
npm ERR! 404 '@tanishka-bansal/npm-practice@1.0.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.
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 npm install
. A rerun of the script was telling me that the package is already there. I deleted it and after another rerun, the 404 error persists, without a created package that no one can install ... Really strange, hope that helps.
npm ERR! code E404
npm ERR! 404 Not Found - PUT https://npm.pkg.github.com/@crstnre%2fgatsby-source-trustpilot - The expected resource was not found.
npm ERR! 404
npm ERR! 404 '@crstnre/gatsby-source-trustpilot@1.0.0' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
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 believe I checked this out with a previous beta version, but trying it out again on
beta.7
seems to be working properly.
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 npm install npm@latest -g
Same issue here. Even upgrading from npm 6.14.10 to latest (8.2.0) does not fix it. Also generating a new github token does not help.
Update: I had changed the package name but not the repository url, so the repository url was invalid. Check your repository url in the package.json. After fixing this the package could be published.
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: