Cli: [BUG] npm unpublishλŠ” μžμ„Έν•œ 둜그 μˆ˜μ€€μ„ μ‚¬μš©ν•˜μ§€ μ•ŠμœΌλ©΄ 였λ₯˜ 404λ₯Ό λ°˜ν™˜ν•˜κ³  였λ₯˜κ°€ μΈμ‡„λ˜μ§€ μ•ŠμŠ΅λ‹ˆλ‹€.

에 λ§Œλ“  2020λ…„ 06μ›” 29일  Β·  14μ½”λ©˜νŠΈ  Β·  좜처: npm/cli

뭐? μ™œ

npm unpublish κ°€ μž‘λ™ν•˜μ§€ μ•ŠμœΌλ©° λ ˆμ§€μŠ€νŠΈλ¦¬κ°€ μ½”λ“œ 404둜 μ‘λ‹΅ν•˜λ”λΌλ„ 였λ₯˜κ°€ ν‘œμ‹œλ˜μ§€ μ•ŠμŠ΅λ‹ˆλ‹€.

μ–Έμ œ

npm unpublish @siliceum/[email protected] --loglevel verbose

μ–΄λ””

npm 곡용 λ ˆμ§€μŠ€νŠΈλ¦¬

μ–΄λ–»κ²Œ

ν˜„μž¬ 행동

λͺ…λ Ή 쀄은

μ„œλ²„λŠ” 였λ₯˜ 404둜 μ‘λ‹΅ν•©λ‹ˆλ‹€.

λ˜ν•œ μ—”λ“œ 포인트 https://registry.npmjs.org/@siliceum%2fcalcite-cli λŠ” 정보λ₯Ό λ°˜ν™˜ν•˜μ§€λ§Œ ?write=true ( https://registry.npmjs.org/@siliceum%2fcalcite-cli?write=true ) 버전은 404 not found 였λ₯˜λ₯Ό λ°˜ν™˜ν•©λ‹ˆλ‹€.

μž¬ν˜„ 단계

npm unpublish @siliceum/[email protected]

μ˜ˆμƒλ˜λŠ” λ™μž‘

νŒ¨ν‚€μ§€κ°€ κ²Œμ‹œλ˜μ§€ μ•Šμ•˜κ±°λ‚˜ 였λ₯˜κ°€ μΈμ‡„λ©λ‹ˆλ‹€. (ꢁ극적으둜 404κ°€ μ•„λ‹Œ λ‹€λ₯Έ 것).
μžμ„Έν•œ 둜그 λ ˆλ²¨μ„ μ‚¬μš©ν•˜λ©΄ λ‹€μŒκ³Ό 같은 좜λ ₯이 κ°€λŠ₯ν•©λ‹ˆλ‹€.

npm unpublish @siliceum/[email protected] --loglevel verbose

npm 정보가 ok둜 λλ‚˜λ©΄ μž‘λ™ν–ˆμŠ΅λ‹ˆλ‹€.
npm 동사 cli [
npm 동사 cli 'C : \ Program Files \ nodejs \ node.exe',
npm 동사 cli 'C : \ Program Files \ nodejs \ node_modules \ npm \ bin \ npm-cli.js',
npm 동사 cli 'unpublish',
npm 동사 cli '@ siliceum / [email protected] ',
npm 동사 cli '--loglevel',
npm 동사 cli 'verbose'
npm 동사 cli]
[email protected]을 μ‚¬μš©ν•œ npm 정보
[email protected]을 μ‚¬μš©ν•œ npm 정보
npm 동사 npm-session e43c8f8257e968e5
npm http fetch GET 404 https://registry.npmjs.org/@siliceum%2fcalcite-cli ? write = true 492ms

κ°€μž₯ μœ μš©ν•œ λŒ“κΈ€

이런! μ‹ κ²½ 쓰지 λ§ˆμ„Έμš”. 방금 둜그 μ•„μ›ƒν–ˆλ‹€κ°€ λ‹€μ‹œ λ‘œκ·ΈμΈν–ˆμŠ΅λ‹ˆλ‹€. 이제 두 κΈ°λŠ₯이 λͺ¨λ‘ μž‘λ™ν•©λ‹ˆλ‹€. ν˜Όλ™μ„ λ“œλ € μ£„μ†‘ν•©λ‹ˆλ‹€.

λͺ¨λ“  14 λŒ“κΈ€

npm unpublish 및 npm deprecate λͺ¨λ‘μ—μ„œμ΄ λ¬Έμ œκ°€ λ°œμƒν•©λ‹ˆλ‹€!

$ npm deprecate --force --verbose [email protected] "Generates errors related to exports in the browser, use 1.2.2 or newer"
...
npm http fetch GET 200 https://registry.npmjs.org/luar?write=true 328ms
npm http fetch PUT 404 https://registry.npmjs.org/luar 98ms
npm verb stack Error: 404 Not Found - PUT https://registry.npmjs.org/luar - Not found
npm verb stack     at /usr/lib/node_modules/npm/node_modules/npm-registry-fetch/check-response.js:114:15
npm verb stack     at processTicksAndRejections (internal/process/task_queues.js:93:5)
npm verb statusCode 404
npm verb pkgid [email protected]
...
npm ERR! code E404
npm ERR! 404 Not Found - PUT https://registry.npmjs.org/luar - Not found
npm ERR! 404 
npm ERR! 404  '[email protected]' 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 unpublish --force --verbose [email protected]
...
npm http fetch GET 200 https://registry.npmjs.org/luar?write=true 257ms
npm http fetch PUT 404 https://registry.npmjs.org/luar/-rev/5-260b27ca1cdb4a5d3b4175578e1c0300 99ms
npm verb stack Error: 404 Not Found - PUT https://registry.npmjs.org/luar/-rev/5-260b27ca1cdb4a5d3b4175578e1c0300 - Not found
npm verb stack     at /usr/lib/node_modules/npm/node_modules/npm-registry-fetch/check-response.js:114:15
npm verb stack     at processTicksAndRejections (internal/process/task_queues.js:93:5)
npm verb statusCode 404
npm verb pkgid [email protected]
...
npm ERR! code E404
npm ERR! 404 Not Found - PUT https://registry.npmjs.org/luar/-rev/5-260b27ca1cdb4a5d3b4175578e1c0300 - Not found
npm ERR! 404 
npm ERR! 404  '[email protected]' 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 deprecate μ‹€ν–‰μ‹œ λ™μΌν•œ λ¬Έμ œκ°€ λ°œμƒ-404 Not Foundκ°€ λ°˜ν™˜λ©λ‹ˆλ‹€. 원인은 λ‚΄κ°€ μ˜¬λ°”λ₯΄κ²Œ μΈμ¦λ˜μ§€ μ•Šμ•˜κΈ° λ•Œλ¬Έμž…λ‹ˆλ‹€ ( npm adduser μ •λ ¬ 됨). κ·ΈλŸ¬λ‚˜ Not Found 좜λ ₯은 μ ‘μ„ μœΌλ‘œ μ΄μ–΄μ§‘λ‹ˆλ‹€. μ„œλ²„ APIκ°€ λ‹€λ₯Έ μƒνƒœ μ½”λ“œ (예 : 401)λ₯Ό λ°˜ν™˜ ν•  κ°€λŠ₯성이 없더라도 μ΄λŸ¬ν•œ λͺ…λ Ήμ˜ 일뢀 좜λ ₯은 λ‘œκ·ΈμΈμ„ μ œμ•ˆν•˜λŠ” 것이 μ’‹μŠ΅λ‹ˆλ‹€. 좜λ ₯은 일반적이고 항상 ν‘œμ‹œλ˜κ±°λ‚˜ ( "λ‘œκ·ΈμΈν–ˆλŠ”μ§€ ν™•μΈν•˜μ‹­μ‹œμ˜€!") authTokenμ΄μ—†λŠ” 경우 ν‘œμ‹œ 될 수 μžˆμŠ΅λ‹ˆλ‹€.

ν•˜μ§€λ§Œ λ‘œκ·ΈμΈν–ˆμŠ΅λ‹ˆλ‹€! 이것은 νŒ¨ν‚€μ§€ μ†Œμœ μžλ‘œ μƒˆ 버전을 κ²Œμ‹œ ν•œ 것과 λ˜‘κ°™μ€ 터미널 μ„Έμ…˜μ— μžˆμŠ΅λ‹ˆλ‹€.

이런! μ‹ κ²½ 쓰지 λ§ˆμ„Έμš”. 방금 둜그 μ•„μ›ƒν–ˆλ‹€κ°€ λ‹€μ‹œ λ‘œκ·ΈμΈν–ˆμŠ΅λ‹ˆλ‹€. 이제 두 κΈ°λŠ₯이 λͺ¨λ‘ μž‘λ™ν•©λ‹ˆλ‹€. ν˜Όλ™μ„ λ“œλ € μ£„μ†‘ν•©λ‹ˆλ‹€.

@luawtf μ•„,이 경우 λ‚΄ 상황과 같은 상황 인 κ²ƒμ²˜λŸΌ λ“€λ¦½λ‹ˆλ‹€.이 λͺ…령은 μ‹€μ œ β€‹β€‹λ¬Έμ œκ°€ 인증과 κ΄€λ ¨λœ 경우 404 Not Foundλ₯Ό ν‘œμ‹œν•©λ‹ˆλ‹€.

λ„€! λ‚˜λŠ” 더 일반적이고 μž₯ν™©ν•œ 였λ₯˜κ°€ 클 κ²ƒμ΄λΌλŠ” 데 λ™μ˜ν•©λ‹ˆλ‹€.
λ˜ν•œ 401 Unauthorizedκ°€ 더 합리적 일 λ•Œ λ ˆμ§€μŠ€νŠΈλ¦¬κ°€ 404λ₯Ό λ°˜ν™˜ν•˜λŠ” μ΄μœ λŠ” λ¬΄μ—‡μž…λ‹ˆκΉŒ?

λ™μ˜ν•©λ‹ˆλ‹€. 이미 곡개 된 νŒ¨ν‚€μ§€μ˜ 경우 μ΄μƒν•˜κ²Œ λ³΄μž…λ‹ˆλ‹€.이 경우 401 λŒ€μ‹  404λ₯Ό λ°˜ν™˜ν•˜μ—¬ λ³΄μ•ˆ μΈ‘λ©΄μ—μ„œ 얻을 μˆ˜μžˆλŠ” 것은 μ—†μŠ΅λ‹ˆλ‹€. ν•΄λ‹Ή URL에 아무것도 μ—†λ‹€λŠ” 사싀을 μ•Œλ¦¬μ§€ μ•ŠκΈ° μœ„ν•΄ 둜그 아웃 ν•  λ•Œ λΉ„κ³΅κ°œ μ €μž₯μ†Œμ— μ•‘μ„ΈμŠ€ν•˜λ €κ³ ν•˜λ©΄ GitHubμ—μ„œ 404λ₯Ό ν‘œμ‹œν•˜λŠ” 것과 같이 νŒ¨ν‚€μ§€κ°€ λΉ„κ³΅κ°œ 인 경우 μ˜λ―Έκ°€ μžˆμŠ΅λ‹ˆλ‹€.

λ‘œκ·ΈμΈν•˜μ§€ μ•Šμ€ λ¬Έμ œμž„μ„ 확인할 수 μžˆμŠ΅λ‹ˆλ‹€.
401을 λ°˜ν™˜ν•˜κ±°λ‚˜ λ‘œκ·ΈμΈν•˜μ§€ μ•Šμ•˜λ‹€λŠ” κ²½κ³  λ©”μ‹œμ§€κ°€ λ‚˜μ—κ²Œ 쒋은 μ†Œλ¦¬μž…λ‹ˆλ‹€.

μš°λ¦¬λŠ” 곡개 νŒ¨ν‚€μ§€λ‘œλ„μ΄ 문제λ₯Ό κ²ͺμ—ˆμŠ΅λ‹ˆλ‹€. npm unpublish @scope/package<strong i="5">@version</strong> --verbose 에 404κ°€ ν‘œμ‹œλ˜μ§€λ§Œ 그렇지 μ•ŠμœΌλ©΄ κ²Œμ‹œ μ·¨μ†Œκ°€ μ„±κ³΅ν•œ κ²ƒμœΌλ‘œ λ³΄μž…λ‹ˆλ‹€.

λ‚΄ νŒ¨ν‚€μ§€λ₯Ό deprecate ν•  수 μ—†λ‹€λŠ” λ™μΌν•œ λ¬Έμ œκ°€ μžˆμŠ΅λ‹ˆλ‹€. νŒ¨ν‚€μ§€ μ΄λ¦„μ˜ μŠ¬λž˜μ‹œκ°€ URLμ—μ„œ %2f 둜 ν‘œμ‹œλ˜λŠ” 것을 μ•Œμ•˜ κΈ° λ•Œλ¬Έμ— νŒ¨ν‚€μ§€ λ²”μœ„ 와 관련이 μžˆλ‹€κ³  κ°€μ •ν–ˆμ§€λ§Œ μ‹€μ œλ‘œ 무슨 일이 μΌμ–΄λ‚˜λŠ”μ§€ μ΄ν•΄ν•˜μ§€ λͺ»ν•©λ‹ˆλ‹€.

$ node -v
v14.15.0
$ npm -v
6.14.8
$ npm deprecate @alling/foo-bar "This package should not be used."
npm ERR! code E404
npm ERR! 404 Not Found - PUT https://registry.npmjs.org/@alling%2ffoo-bar - Not found
npm ERR! 404 
npm ERR! 404  '@alling/foo-bar<strong i="9">@latest</strong>' 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.

@SimonAlling npm v7.0.11은 μ–΄λ–»κ²Œ λ˜λ‚˜μš”?

@SimonAlling npm v7.0.11은 μ–΄λ–»κ²Œ λ˜λ‚˜μš”?

$ docker run -it node bash
# npm -v
7.0.8
# npm login
Logged in as alling on https://registry.npmjs.org/.
npm notice 
npm notice New patch version of npm available! 7.0.8 -> 7.0.11
npm notice Changelog: https://github.com/npm/cli/releases/tag/v7.0.11
npm notice Run npm install -g [email protected] to update!
npm notice 
# npm deprecate nonexisting-package-asdfasdf LOL
npm ERR! code E404
npm ERR! 404 Not Found - GET https://registry.npmjs.org/nonexisting-package-asdfasdf?write=true
npm ERR! 404 
npm ERR! 404  'nonexisting-package-asdfasdf<strong i="8">@latest</strong>' 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 deprecate @alling/foo-bar "This package should not be used."

였λ₯˜λ‚˜ 기타 좜λ ₯은 μ—†μ§€λ§Œ 30 λΆ„ 정도 후에도 νŒ¨ν‚€μ§€ νŽ˜μ΄μ§€ (예 : https://www.npmjs.com/package/@alling/foo-bar)에 μ‚¬μš© 쀑단 λ©”μ‹œμ§€κ°€ ν‘œμ‹œλ˜μ§€ μ•Šμ•˜μœΌλ―€λ‘œ λ‹€μ‹œ λͺ…λ Ήν•˜μ‹­μ‹œμ˜€.

# npm deprecate @alling/foo-bar "This package should not be used."
npm ERR! code E422
npm ERR! 422 Unprocessable Entity - PUT https://registry.npmjs.org/@alling%2ffoo-bar - Unprocessable Entity

κ·ΈλŸ¬λ‚˜ νŠΉμ • λ²„μ „μ˜ νŒ¨ν‚€μ§€ (예 : https://www.npmjs.com/package/@alling/foo-bar/v/1.1.6)둜 μ΄λ™ν•˜λ©΄ μ˜ˆμƒλ˜λŠ” 지원 쀑단 λ©”μ‹œμ§€κ°€ ν‘œμ‹œλ©λ‹ˆλ‹€ *. ν•˜μ§€λ§Œ 메인 νŒ¨ν‚€μ§€ νŽ˜μ΄μ§€μ—λ„ ν‘œμ‹œλ˜κΈ°λ₯Ό μ›ν•©λ‹ˆλ‹€ (예 : urix ).

* μ΅œμ‹  버전 : _이 νŒ¨ν‚€μ§€ λŠ” 더 이상 μ‚¬μš©λ˜μ§€ μ•ŠμŠ΅λ‹ˆλ‹€ _. 기타 λͺ¨λ“  버전 : _이 버전 은 더 이상 μ‚¬μš©λ˜μ§€ μ•ŠμŠ΅λ‹ˆλ‹€ _.

νŽΈμ§‘ : deprecation λ©”μ‹œμ§€κ°€ λ§ˆμΉ¨λ‚΄ 메인 νŒ¨ν‚€μ§€ νŽ˜μ΄μ§€μ— λ‚˜νƒ€λ‚¬μŠ΅λ‹ˆλ‹€.

npm v7.0.8을 μ‚¬μš©ν•˜κ³  μžˆμŠ΅λ‹ˆλ‹€. deprecate λͺ…령을 μ‹€ν–‰ν•˜κΈ° 전에 npm install -g npm@7 ν•  수 μžˆμŠ΅λ‹ˆκΉŒ?

deprecation λ©”μ‹œμ§€λŠ” λ§ˆμΉ¨λ‚΄ 메인 νŒ¨ν‚€μ§€ νŽ˜μ΄μ§€μ— λ‚˜νƒ€ λ‚¬μœΌλ―€λ‘œ npm v7.0.8μ—μ„œ μž‘λ™ν•œλ‹€κ³  μƒκ°ν•©λ‹ˆλ‹€. : slightly_smiling_face :

이 νŽ˜μ΄μ§€κ°€ 도움이 λ˜μ—ˆλ‚˜μš”?
0 / 5 - 0 λ“±κΈ‰