npm / cli

the package manager for JavaScript
https://docs.npmjs.com/cli/
Other
8.49k stars 3.17k forks source link

[BUG] 7.x - 404 when installing with `.npmrc` with github package registry #1654

Closed nicholas-ochoa closed 4 years ago

nicholas-ochoa commented 4 years ago

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:

$ cat ~/.npmrc
//npm.pkg.github.com/:_authToken=########################################
@zethcon:registry=https://npm.pkg.github.com

Run npm install:

$ npm install
npm ERR! code E404
npm ERR! 404 Not Found - GET https://npm.pkg.github.com/strip-ansi
npm ERR! 404
npm ERR! 404  'strip-ansi@^6.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.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/synapse/.npm/_logs/2020-08-11T18_16_56_669Z-debug.log

$ cat /home/synapse/.npm/_logs/2020-08-11T18_16_56_669Z-debug.log
0 verbose cli [
0 verbose cli   '/opt/zethcon/bin/nvm/versions/node/v14.8.0/bin/node',
0 verbose cli   '/opt/zethcon/bin/nvm/versions/node/v14.8.0/bin/npm',
0 verbose cli   'install'
0 verbose cli ]
1 info using npm@7.0.0-beta.4
2 info using node@v14.8.0
3 verbose npm-session 748616aa405b2a3e
4 timing npm:load Completed in 19ms
5 timing arborist:ctor Completed in 0ms
6 timing arborist:ctor Completed in 0ms
7 timing idealTree:init Completed in 17ms
8 timing idealTree:userRequests Completed in 1ms
9 silly idealTree buildDeps
10 http fetch GET 404 ***https://npm.pkg.github.com/js-yaml 187ms
11 http fetch GET 404 ***https://npm.pkg.github.com/strip-ansi 187ms
12 http fetch GET 404 ***https://npm.pkg.github.com/oracledb 192ms
13 http fetch GET 404 ***https://npm.pkg.github.com/superagent 189ms
14 http fetch GET 404 ***https://npm.pkg.github.com/table 189ms
15 http fetch GET 404 ***https://npm.pkg.github.com/chalk 199ms
16 http fetch GET 404 ***https://npm.pkg.github.com/promise-socket 198ms
17 http fetch GET 404 ***https://npm.pkg.github.com/source-map-support 201ms
18 http fetch GET 404 ***https://npm.pkg.github.com/uuid 199ms
19 http fetch GET 404 ***https://npm.pkg.github.com/date-fns 209ms
20 http fetch GET 404 ***https://npm.pkg.github.com/xml2js 203ms
21 http fetch GET 404 ***https://npm.pkg.github.com/clean-webpack-plugin 189ms
22 http fetch GET 404 ***https://npm.pkg.github.com/cross-env 190ms
23 http fetch GET 404 ***https://npm.pkg.github.com/eslint 188ms
24 http fetch GET 404 ***https://npm.pkg.github.com/eslint-config-prettier 190ms
25 http fetch GET 404 ***https://npm.pkg.github.com/eslint-loader 194ms
26 http fetch GET 404 ***https://npm.pkg.github.com/eslint-plugin-json 195ms
27 http fetch GET 404 ***https://npm.pkg.github.com/eslint-plugin-prettier 197ms
28 http fetch GET 404 ***https://npm.pkg.github.com/jest 198ms
29 http fetch GET 404 ***https://npm.pkg.github.com/jest-mock-process 199ms
30 http fetch GET 404 ***https://npm.pkg.github.com/nodemon-webpack-plugin 200ms
31 http fetch GET 404 ***https://npm.pkg.github.com/nodemon 204ms
32 http fetch GET 404 ***https://npm.pkg.github.com/prettier 204ms
33 http fetch GET 404 ***https://npm.pkg.github.com/ts-jest 210ms
34 http fetch GET 404 ***https://npm.pkg.github.com/ts-loader 211ms
35 http fetch GET 404 ***https://npm.pkg.github.com/tsconfig-paths-webpack-plugin 211ms
36 http fetch GET 404 ***https://npm.pkg.github.com/typescript 207ms
37 http fetch GET 404 ***https://npm.pkg.github.com/webpack 209ms
38 http fetch GET 404 ***https://npm.pkg.github.com/webpackbar 208ms
39 http fetch GET 404 ***https://npm.pkg.github.com/webpack-cli 212ms
40 http fetch GET 404 ***https://npm.pkg.github.com/webpack-node-externals 213ms
41 http fetch GET 404 ***https://npm.pkg.github.com/@typescript-eslint%2feslint-plugin 251ms
42 http fetch GET 404 ***https://npm.pkg.github.com/@typescript-eslint%2fparser 252ms
43 http fetch GET 404 ***https://npm.pkg.github.com/strip-ansi 106ms
44 http fetch GET 404 ***https://npm.pkg.github.com/js-yaml 115ms
45 http fetch GET 404 ***https://npm.pkg.github.com/oracledb 124ms
46 http fetch GET 404 ***https://npm.pkg.github.com/superagent 137ms
47 http fetch GET 404 ***https://npm.pkg.github.com/table 141ms
48 http fetch GET 404 ***https://npm.pkg.github.com/chalk 163ms
49 http fetch GET 404 ***https://npm.pkg.github.com/promise-socket 162ms
50 http fetch GET 404 ***https://npm.pkg.github.com/uuid 176ms
51 http fetch GET 404 ***https://npm.pkg.github.com/source-map-support 184ms
52 http fetch GET 404 ***https://npm.pkg.github.com/date-fns 192ms
53 http fetch GET 404 ***https://npm.pkg.github.com/xml2js 205ms
54 http fetch GET 404 ***https://npm.pkg.github.com/clean-webpack-plugin 205ms
55 http fetch GET 404 ***https://npm.pkg.github.com/eslint 220ms
56 http fetch GET 404 ***https://npm.pkg.github.com/cross-env 225ms
57 http fetch GET 404 ***https://npm.pkg.github.com/eslint-config-prettier 237ms
58 http fetch GET 404 ***https://npm.pkg.github.com/eslint-loader 242ms
59 http fetch GET 404 ***https://npm.pkg.github.com/eslint-plugin-json 249ms
60 http fetch GET 404 ***https://npm.pkg.github.com/jest 263ms
61 http fetch GET 404 ***https://npm.pkg.github.com/eslint-plugin-prettier 268ms
62 http fetch GET 404 ***https://npm.pkg.github.com/jest-mock-process 282ms
63 http fetch GET 404 ***https://npm.pkg.github.com/nodemon-webpack-plugin 288ms
64 http fetch GET 200 ***https://npm.pkg.github.com/@types%2fxml2js 508ms
65 http fetch GET 200 ***https://npm.pkg.github.com/@types%2ftable 516ms
66 http fetch GET 404 ***https://npm.pkg.github.com/prettier 298ms
67 http fetch GET 404 ***https://npm.pkg.github.com/nodemon 304ms
68 http fetch GET 404 ***https://npm.pkg.github.com/ts-jest 295ms
69 http fetch GET 200 ***https://npm.pkg.github.com/@types%2fjs-yaml 544ms
70 http fetch GET 404 ***https://npm.pkg.github.com/ts-loader 303ms
71 http fetch GET 404 ***https://npm.pkg.github.com/tsconfig-paths-webpack-plugin 305ms
72 http fetch GET 404 ***https://npm.pkg.github.com/webpack 307ms
73 http fetch GET 404 ***https://npm.pkg.github.com/typescript 314ms
74 http fetch GET 404 ***https://npm.pkg.github.com/webpackbar 313ms
75 http fetch GET 404 ***https://npm.pkg.github.com/webpack-node-externals 315ms
76 http fetch GET 404 ***https://npm.pkg.github.com/webpack-cli 320ms
77 http fetch GET 200 ***https://npm.pkg.github.com/@zethcon%2fconfig 620ms
78 http fetch GET 200 ***https://npm.pkg.github.com/@types%2fsuperagent 620ms
79 http fetch GET 200 ***https://npm.pkg.github.com/@types%2fuuid 614ms
80 http fetch GET 200 ***https://npm.pkg.github.com/@types%2foracledb 623ms
81 http fetch GET 404 ***https://npm.pkg.github.com/@typescript-eslint%2feslint-plugin 391ms
82 http fetch GET 404 ***https://npm.pkg.github.com/@typescript-eslint%2fparser 392ms
83 http fetch GET 200 ***https://npm.pkg.github.com/@zethcon%2faq 828ms
84 http fetch GET 200 ***https://npm.pkg.github.com/@types%2fjest 937ms
85 http fetch GET 200 ***https://npm.pkg.github.com/@types%2fnode 1780ms
86 silly placeDep @types/jest@^26.0.9 Symbol(OK) for: @zethcon/server@0.0.1
87 silly placeDep @types/js-yaml@^3.12.5 Symbol(OK) for: @zethcon/server@0.0.1
88 silly placeDep @types/node@^14.0.27 Symbol(OK) for: @zethcon/server@0.0.1
89 silly placeDep @types/oracledb@^5.0.0 Symbol(OK) for: @zethcon/server@0.0.1
90 silly placeDep @types/superagent@^4.1.8 Symbol(OK) for: @zethcon/server@0.0.1
91 silly placeDep @types/table@^5.0.0 Symbol(OK) for: @zethcon/server@0.0.1
92 silly placeDep @types/uuid@^8.0.1 Symbol(OK) for: @zethcon/server@0.0.1
93 silly placeDep @types/xml2js@^0.4.5 Symbol(OK) for: @zethcon/server@0.0.1
94 silly placeDep @typescript-eslint/eslint-plugin@^3.8.0 Symbol(OK) for: @zethcon/server@0.0.1
95 silly placeDep @typescript-eslint/parser@^3.8.0 Symbol(OK) for: @zethcon/server@0.0.1
96 silly placeDep @zethcon/aq@0.4.3 Symbol(OK) for: @zethcon/server@0.0.1
97 silly placeDep @zethcon/config@1.0.1 Symbol(OK) for: @zethcon/server@0.0.1
98 silly placeDep chalk@^4.1.0 Symbol(OK) for: @zethcon/server@0.0.1
99 silly placeDep clean-webpack-plugin@^3.0.0 Symbol(OK) for: @zethcon/server@0.0.1
100 silly placeDep cross-env@^7.0.2 Symbol(OK) for: @zethcon/server@0.0.1
101 silly placeDep date-fns@^2.15.0 Symbol(OK) for: @zethcon/server@0.0.1
102 silly placeDep eslint@^7.6.0 Symbol(OK) for: @zethcon/server@0.0.1
103 silly placeDep eslint-config-prettier@^6.11.0 Symbol(OK) for: @zethcon/server@0.0.1
104 silly placeDep eslint-loader@^4.0.2 Symbol(OK) for: @zethcon/server@0.0.1
105 silly placeDep eslint-plugin-json@^2.1.2 Symbol(OK) for: @zethcon/server@0.0.1
106 silly placeDep eslint-plugin-prettier@^3.1.4 Symbol(OK) for: @zethcon/server@0.0.1
107 silly placeDep jest@^26.2.2 Symbol(OK) for: @zethcon/server@0.0.1
108 silly placeDep jest-mock-process@^1.4.0 Symbol(OK) for: @zethcon/server@0.0.1
109 silly placeDep js-yaml@^3.14.0 Symbol(OK) for: @zethcon/server@0.0.1
110 silly placeDep nodemon@^2.0.4 Symbol(OK) for: @zethcon/server@0.0.1
111 silly placeDep nodemon-webpack-plugin@^4.3.2 Symbol(OK) for: @zethcon/server@0.0.1
112 silly placeDep oracledb@^5.0.0 Symbol(OK) for: @zethcon/server@0.0.1
113 silly placeDep prettier@^2.0.5 Symbol(OK) for: @zethcon/server@0.0.1
114 silly placeDep promise-socket@^6.0.3 Symbol(OK) for: @zethcon/server@0.0.1
115 silly placeDep source-map-support@^0.5.19 Symbol(OK) for: @zethcon/server@0.0.1
116 silly placeDep strip-ansi@^6.0.0 Symbol(OK) for: @zethcon/server@0.0.1
117 silly placeDep superagent@^5.3.1 Symbol(OK) for: @zethcon/server@0.0.1
118 silly placeDep table@^5.4.6 Symbol(OK) for: @zethcon/server@0.0.1
119 silly placeDep ts-jest@^26.1.4 Symbol(OK) for: @zethcon/server@0.0.1
120 silly placeDep ts-loader@^8.0.2 Symbol(OK) for: @zethcon/server@0.0.1
121 silly placeDep tsconfig-paths-webpack-plugin@^3.3.0 Symbol(OK) for: @zethcon/server@0.0.1
122 silly placeDep typescript@^3.9.7 Symbol(OK) for: @zethcon/server@0.0.1
123 silly placeDep uuid@^8.3.0 Symbol(OK) for: @zethcon/server@0.0.1
124 silly placeDep webpack@^4.44.1 Symbol(OK) for: @zethcon/server@0.0.1
125 silly placeDep webpack-cli@^3.3.12 Symbol(OK) for: @zethcon/server@0.0.1
126 silly placeDep webpack-node-externals@^2.5.1 Symbol(OK) for: @zethcon/server@0.0.1
127 silly placeDep webpackbar@^4.0.0 Symbol(OK) for: @zethcon/server@0.0.1
128 silly placeDep xml2js@^0.4.23 Symbol(OK) for: @zethcon/server@0.0.1
129 http fetch GET 404 ***https://npm.pkg.github.com/pretty-format 32ms
130 http fetch GET 404 ***https://npm.pkg.github.com/jest-diff 35ms
131 http fetch GET 404 ***https://npm.pkg.github.com/lodash 35ms
132 http fetch GET 404 ***https://npm.pkg.github.com/dotenv 41ms
133 http fetch GET 404 ***https://npm.pkg.github.com/jest-diff 24ms
134 http fetch GET 404 ***https://npm.pkg.github.com/pretty-format 28ms
135 http fetch GET 404 ***https://npm.pkg.github.com/dotenv 24ms
136 http fetch GET 404 ***https://npm.pkg.github.com/lodash 29ms
137 http fetch GET 200 ***https://npm.pkg.github.com/@types%2fcookiejar 263ms
138 http fetch GET 200 ***https://npm.pkg.github.com/@types%2flodash 346ms
139 timing idealTree:#root Completed in 2170ms
140 silly placeDep node_modules/@types/jest jest-diff@^25.2.1 Symbol(OK) for: @types/jest@26.0.9
141 silly placeDep jest-diff@^25.2.1 Symbol(OK) for: @types/jest@26.0.9
142 silly placeDep node_modules/@types/jest pretty-format@^25.2.1 Symbol(OK) for: @types/jest@26.0.9
143 silly placeDep pretty-format@^25.2.1 Symbol(OK) for: @types/jest@26.0.9
144 timing idealTree:node_modules/@types/jest Completed in 2ms
145 timing idealTree:node_modules/@types/js-yaml Completed in 0ms
146 timing idealTree:node_modules/@types/node Completed in 0ms
147 silly placeDep node_modules/@types/oracledb dotenv@^8.2.0 Symbol(OK) for: @types/oracledb@5.0.0
148 silly placeDep dotenv@^8.2.0 Symbol(OK) for: @types/oracledb@5.0.0
149 timing idealTree:node_modules/@types/oracledb Completed in 1ms
150 silly placeDep node_modules/@types/superagent @types/cookiejar@* Symbol(OK) for: @types/superagent@4.1.9
151 silly placeDep @types/cookiejar@* Symbol(OK) for: @types/superagent@4.1.9
152 timing idealTree:node_modules/@types/superagent Completed in 1ms
153 timing idealTree:node_modules/@types/cookiejar Completed in 0ms
154 timing idealTree:node_modules/@types/table Completed in 0ms
155 timing idealTree:node_modules/@types/uuid Completed in 0ms
156 timing idealTree:node_modules/@types/xml2js Completed in 0ms
157 timing idealTree:node_modules/@typescript-eslint/eslint-plugin Completed in 0ms
158 timing idealTree:node_modules/@typescript-eslint/parser Completed in 0ms
159 timing idealTree:node_modules/@zethcon/aq Completed in 0ms
160 silly placeDep node_modules/@zethcon/config @types/lodash@^4.14.157 Symbol(OK) for: @zethcon/config@1.0.1
161 silly placeDep @types/lodash@^4.14.157 Symbol(OK) for: @zethcon/config@1.0.1
162 silly placeDep node_modules/@zethcon/config chalk@^4.1.0 Symbol(OK) for: @zethcon/config@1.0.1
163 silly placeDep chalk@^4.1.0 Symbol(CONFLICT) for: @zethcon/config@1.0.1
164 silly placeDep node_modules/@zethcon/config lodash@^4.17.19 Symbol(OK) for: @zethcon/config@1.0.1
165 silly placeDep lodash@^4.17.19 Symbol(OK) for: @zethcon/config@1.0.1
166 timing idealTree:node_modules/@zethcon/config Completed in 2ms
167 timing idealTree:node_modules/@types/lodash Completed in 0ms
168 timing idealTree:node_modules/chalk Completed in 0ms
169 timing idealTree:node_modules/clean-webpack-plugin Completed in 0ms
170 timing idealTree:node_modules/cross-env Completed in 0ms
171 timing idealTree:node_modules/date-fns Completed in 0ms
172 timing idealTree:node_modules/dotenv Completed in 0ms
173 timing idealTree:node_modules/eslint Completed in 0ms
174 timing idealTree:node_modules/eslint-config-prettier Completed in 0ms
175 timing idealTree:node_modules/eslint-loader Completed in 0ms
176 timing idealTree:node_modules/eslint-plugin-json Completed in 0ms
177 timing idealTree:node_modules/eslint-plugin-prettier Completed in 0ms
178 timing idealTree:node_modules/jest Completed in 0ms
179 timing idealTree:node_modules/jest-diff Completed in 0ms
180 timing idealTree:node_modules/jest-mock-process Completed in 0ms
181 timing idealTree:node_modules/js-yaml Completed in 0ms
182 timing idealTree:node_modules/lodash Completed in 0ms
183 timing idealTree:node_modules/nodemon Completed in 0ms
184 timing idealTree:node_modules/nodemon-webpack-plugin Completed in 0ms
185 timing idealTree:node_modules/oracledb Completed in 0ms
186 timing idealTree:node_modules/prettier Completed in 0ms
187 timing idealTree:node_modules/pretty-format Completed in 0ms
188 timing idealTree:node_modules/promise-socket Completed in 0ms
189 timing idealTree:node_modules/source-map-support Completed in 0ms
190 timing idealTree:node_modules/strip-ansi Completed in 0ms
191 timing idealTree:node_modules/superagent Completed in 0ms
192 timing idealTree:node_modules/table Completed in 0ms
193 timing idealTree:node_modules/ts-jest Completed in 0ms
194 timing idealTree:node_modules/ts-loader Completed in 0ms
195 timing idealTree:node_modules/tsconfig-paths-webpack-plugin Completed in 0ms
196 timing idealTree:node_modules/typescript Completed in 0ms
197 timing idealTree:node_modules/uuid Completed in 0ms
198 timing idealTree:node_modules/webpack Completed in 0ms
199 timing idealTree:node_modules/webpack-cli Completed in 0ms
200 timing idealTree:node_modules/webpack-node-externals Completed in 0ms
201 timing idealTree:node_modules/webpackbar Completed in 0ms
202 timing idealTree:node_modules/xml2js Completed in 0ms
203 timing idealTree:node_modules/@zethcon/config/node_modules/chalk Completed in 0ms
204 timing idealTree:buildDeps Completed in 2184ms
205 timing idealTree:fixDepFlags Completed in 1ms
206 timing idealTree Completed in 2203ms
207 timing command:install Completed in 2206ms
208 verbose stack Error: 404 Not Found - GET https://npm.pkg.github.com/strip-ansi
208 verbose stack     at /opt/zethcon/bin/nvm/versions/node/v14.8.0/lib/node_modules/npm/node_modules/npm-registry-fetch/check-response.js:119:15
208 verbose stack     at processTicksAndRejections (internal/process/task_queues.js:93:5)
208 verbose stack     at async Promise.all (index 8)
208 verbose stack     at async Arborist.[buildDepStep] (/opt/zethcon/bin/nvm/versions/node/v14.8.0/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js:575:19)
208 verbose stack     at async Arborist.buildIdealTree (/opt/zethcon/bin/nvm/versions/node/v14.8.0/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js:160:7)
208 verbose stack     at async Promise.all (index 1)
208 verbose stack     at async Arborist.reify (/opt/zethcon/bin/nvm/versions/node/v14.8.0/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/reify.js:126:5)
208 verbose stack     at async install (/opt/zethcon/bin/nvm/versions/node/v14.8.0/lib/node_modules/npm/lib/install.js:40:5)
209 verbose statusCode 404
210 verbose pkgid strip-ansi@^6.0.0
211 verbose cwd /opt/zethcon/working/server
212 verbose Linux 4.18.0-193.6.3.el8_2.x86_64
213 verbose argv "/opt/zethcon/bin/nvm/versions/node/v14.8.0/bin/node" "/opt/zethcon/bin/nvm/versions/node/v14.8.0/bin/npm" "install"
214 verbose node v14.8.0
215 verbose npm  v7.0.0-beta.4
216 error code E404
217 error 404 Not Found - GET https://npm.pkg.github.com/strip-ansi
218 error 404
219 error 404 'strip-ansi@^6.0.0' is not in the npm registry.
220 error 404 You should bug the author to publish it (or use the name yourself!)
221 error 404 Note that you can also install from a
222 error 404 tarball, folder, http url, or git url.
223 verbose exit [ 1, true ]

If I remove the github registry from ~/.npmrc, the install progresses but fails when it encounters our scoped packages:

$ npm install
npm ERR! code E404
npm ERR! 404 Not Found - GET https://registry.npmjs.org/@zethcon%2fconfig - Not found
npm ERR! 404
npm ERR! 404  '@zethcon/config@1.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.

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:

nicholas-ochoa commented 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"
ruyadorno commented 4 years ago

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

leandro-manifesto commented 4 years ago

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.

ruyadorno commented 4 years ago

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

nicholas-ochoa commented 4 years ago

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.

leandro-manifesto commented 4 years ago

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.

nicholas-ochoa commented 4 years ago

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.

leandro-manifesto commented 4 years ago

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.

ruyadorno commented 4 years ago

sounds great 👍 thank you all for the feedback, and specially @nicholas-ochoa for the reproducible repo, I'll give it another try!

leandro-manifesto commented 4 years ago

beta.9 works like a charm.

ruyadorno commented 4 years ago

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!

nicholas-ochoa commented 4 years ago

beta.9 is working for me as well!

tanishkab commented 3 years ago

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?

carstenjaksch commented 3 years ago

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!)
MohitDeshwal commented 2 years ago

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.

dylan-westbury commented 2 years ago

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

Flowr-es commented 2 years ago

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.