๊ธฐ๋ฅ ์ ์์ฒญํ๊ฑฐ๋ ๋ฒ๊ทธ๋ฅผ๋ณด๊ณ ํ์๊ฒ ์ต๋๊น?
๊ณค์ถฉ
ํ์ฌ ํ๋์ ๋ฌด์์
๋๊น?
์ ์ฌ๋ .npmrc๋ฅผ ์กด์คํ์ง ์์ต๋๋ค.
ํ์ฌ ๋์์ด ๋ฒ๊ทธ ์ธ ๊ฒฝ์ฐ ์ฌํ ๋จ๊ณ๋ฅผ ์ ๊ณตํ์ญ์์ค.
๋ฆฌํฌ์งํ ๋ฆฌ ์ค ํ๋์ ๋ํ ์ธ์ฆ์ด ํ์ํ๋ฉฐ .npmrc์ ์ธ์ฆ์ ์ง์ ํ์ฌ์ด๋ฅผ ์ํํ์ต๋๋ค. ์ด๊ฒ์ 0.28.4๊น์ง ์๋ํ์ง๋ง 1.0.0์์ ๊นจ์ก์ต๋๋ค.
์์๋๋ ๋์์ ๋ฌด์์
๋๊น?
.npmrc์ ์ธ์ฆ ์ค์ ์ค์
node.js, yarn ๋ฐ ์ด์ ์ฒด์ ๋ฒ์ ์ ์ธ๊ธํ์ญ์์ค.
yarn์ 1.0.0 / 1.0.1๋ก ์
๊ทธ๋ ์ด๋ ํ ํ์ ๋ฐ์ํฉ๋๋ค (๋ ๋ฒ์ ์ ๋ชจ๋ ์๋). OS ๋ฐ nodejs ๋ฒ์ ์ ๊ด๊ณ์์ด.
์ด๊ฒ์ ์ด์ ๋ฆด๋ฆฌ์ค ๋ 1.0.2์์ ์์ ๋์ด์ผํฉ๋๋ค. ์คํ์ ์ค ์ ์์ต๋๊น?
@BYK ๋๋ ์์ ๊ฐ์ ๋ฌธ์ ๋ฅผ ๊ฒช๊ณ ์์ผ๋ฉฐ # 4157์ ๋์ ์ธ๊ธํ์ต๋๋ค. 1.0.2
์คํ์ ์๋ํ์ง๋ง 404
์คํจํ์ต๋๋ค. 0.27.5
์์ ์คํํ๋ฉด ์์๋๋ก ์๋ํฉ๋๋ค.
๋ณต์ ๋ฅผ ์๋ ํ ์ ์๋๋ก ์ฌ๊ธฐ์ npmrc ํ์ผ์ ๋ถ์ฌ ๋ฃ์ ์ ์์ต๋๊น (๋ถ๋ช ํ ๋น๋ฐ ๋๋ ๊ธฐํ ๊ฐ์ธ ์ ๋ณด๋ฅผ ํธ์ง)
@KidkArolis ๋ด ์์ ๋๋ ํ ๋ฆฌ๋ฅผ ๊ฐ๋ฅํ ํ ๊นจ๋ํ๊ฒ ์ป์ผ๋ ค๊ณ ์๋ํ๋ ๋์ ์ด๋ป๊ฒ ๋ ๋ฌธ์ ๊ฐ ํด๊ฒฐ ๋์์ต๋๊น? ๐
๋ด๊ฐ ์ทจํ ๋จ๊ณ :
yarn.lock
๋ฐ ๋ชจ๋ yarn-error.log
ํ์ผ ์ญ์ node_modules/
์ญ์ brew link yarn
๋ฐ yarn --version
๋ก 1.0.2
yarn
ํจ๊ณผ๊ฐ์๋ ๊ฒ ๊ฐ์ต๋๋ค. ์ ๋ ์ด๊ฒ์ ์ ์ ์ ํ์ ์ฌ์ฉ์ ์ค๋ฅ๋ก ๋ถ๋ฅ ํ ๊ฒ์ ๋๋ค.
@beardedtim ๋ฌด์์ ๋ํด ๋น์ ์ ์ง๊ธ ๋ ๋ ค ๊ฒฝ์ฐ node_modules
ํ์ง๋ง, ๊ณ์ yarn.lock
๋ค์ ์คํ yarn install
? ๊ทธ๋ฌ๋ฉด ๋ชจ๋ ์๋ํฉ๋๊น? ์ด๊ฒ์ ๋ถ๋ถ์ ์ผ๋ก # 4157 ํธ๋์ด์ง๋ง ๋ ํฐ ๋ฌธ์ ์ ๊ด๋ จ์ด์์ ์ ์์ต๋๊น?
์์ฌ ๋ฒ์ 1.0.1 ๋ฐ 1.0.2์ ๋ํด์ด ๋ฌธ์ (๋ด๊ฐ ์ฌ์ฉํ๋ ๋ ์ง์คํธ๋ฆฌ์ ๊ด๊ณ์์ด ๊ฐ์ธ ๋ฒ์ ์ ์ฅ์์ 404)๊ฐ ๋ฐ์ํฉ๋๋ค. ๋ฒ์ 0.27.5๋ ์ผ๋ถ ์ํฐํฉํธ๋ฅผ ์ง์ด ํ์ ์๋ํ์ต๋๋ค.
https://github.com/yarnpkg/yarn/issues/4157 ์์ ๋ ผ์ ๋ ๋ชจ๋ ํด๊ฒฐ ๋ฐฉ๋ฒ์ ์๋ํ์ต๋๋ค
@stieg ์ค๋ ๋ฆ๊ฒ ์ ์ฌ ์๊ฐ์ ๋ฌด๋ฃ ์๊ฐ์ ์ป๊ณ ๊ฒฐ๊ณผ๋ฅผ ๊ฒ์ ํ ๋ ์๋ํด
๋๊ตฌ๋ ์ง ์ด๊ฒ์ ๋ํ ํด๊ฒฐ์ฑ ์ ์ฐพ์์ต๋๊น?
FWIW : ๋ค์๊ณผ ๊ฐ์ด ์๋ํ์ต๋๋ค.
node_modules
์ด๊ธฐํ~/.yarn
์ด๊ธฐํcurl -o- -L https://yarnpkg.com/install.sh | bash
-yarn 1.0.2 ์ฌ์ค์นyarn install
-_ ์ค๋ฅ ์์ _, ๋ชจ๋ ๊ฒ์ ์๋ฒฝํ๊ฒ ์ค์นํ์ต๋๋ค.๋ด ~/.yarnrc
:
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1
registry "https://registry.npmjs.org"
email [email protected]
lastUpdateCheck 1505977814820
username some-user
````
And my `~/.npmrc`:
//registry.npmjs.org/:_authToken=a-valid-uuid
The `yarn.lock` references look like this in my particular case:
" https://registry.npmjs.org/@acme/some -module /-/ some-module-0.1.1.tgz # valid-git-sha"ํด๊ฒฐ๋จ
```
ํฅ๋ฏธ ๋กญ๊ตฐ. .yarnrc
ํ์ผ์ ๋ ์ง์คํธ๋ฆฌ๋ฅผ ๋ฃ์ ํ ํจํค์ง๋ฅผ ์ค์นํ ์์์์ต๋๋ค. ๊ทธ๋ฌ๋ ๊ทธ๊ฒ์ด ๋ฒ์ธ์ธ์ง ํ์ธํ๊ธฐ ์ํด ์ ๊ฑฐํ์ง๋ง ์ฌ์ ํ ์ฑ๊ณตํ์ต๋๋ค (Yarn์ด ๊ทธ๊ฒ์ ๋ค์ด๋ก๋ํด์ผํ๊ธฐ ๋๋ฌธ์ ์บ์๋ฅผ ์ญ์ ํ์ผ๋ฉฐ ์ฌ๋ฐ๋ฅด๊ฒ ์ํํ์ต๋๋ค).
์๋ก ์ค์น (์ด๋ฒ์๋ ๋ฐ๋น์, ๋ค๋ฅธ ํ๋๋ macOS)๋ฅผ ์๋ํ๊ณ ~/.npmrc
๋ฐ ~/.yarnrc
์์ ์ด๋ฌํ ์ค์ ์ด ๋๊ฐ์ด ์ ์๋ํ์ต๋๋ค. (์ฐธ๊ณ : npm login
๋๋ yarn login
์๋ํ์ง ์์์ต๋๋ค.)
์ด ๋ฌธ์ ๋ฅผ๋ณด๊ณ ํ๋ ์ฌ๋๋ค์ด ํด๊ฒฐ๋จ์ ๋ฐ๋ผ ๋ซํ๋๋ค. @carlosduclos๊ฐ ํด๊ฒฐ๋์ง ์์ผ๋ฉด ๊ตฌ์ฒด์ ์ธ ์ฌํ ๋จ๊ณ๋ก ๋ค์ ์ฝ๋ ๋ค.
@BYK ๋๋ ๊ฐ์ ๋ฌธ์ ๊ฐ ์์๋ค.
์ต์ ์์ฌ ๋ฒ์ ์ ์๋ก ์ค์น๋ฅผ ์ฌ์ฉํ์ต๋๋ค.
๊ทธ๋ฆฌ๊ณ ~/.yarnrc
์ registry "https://registry.npmjs.org"
์ ์ถ๊ฐํ๋ฉด ์๋ํ๊ธฐ ์์ํฉ๋๋ค.
๋ฒ๊ทธ๋ผ๊ณ ์๊ฐํ๋ฉฐ ์๋์ด ์๋๋ผ ์๋์ผ๋ก ํด๊ฒฐํด์ผํฉ๋๋ค.
@BYK "ํด๊ฒฐ ๋ ๊ฒ์ผ๋ก๋ณด๊ณ "ํ ๋ชจ๋ ์ฌ๋์ด yarn์ด https://registry.npmjs.org ๋ ์ง์คํธ๋ฆฌ๋ฅผ ์ฌ์ฉํ๋๋ก ๊ฐ์ ํ๋ ํด๊ฒฐ ๋ฐฉ๋ฒ์ ์ฌ์ฉํ๋ค๋ ์ ์ ์์ ๋๋ฉด ๋์์ด ๋ ์ ์์ต๋๋ค.
https://registry.yarnpkg.com ๋ ์ง์คํธ๋ฆฌ์์ ๊ฐ์ธ ํจํค์ง๋ฅผ ๊ฒ์ํ๋ ๋ฐ ์ฌ์ ํ ๋ฌธ์ ๊ฐ ์๋ค๊ณ ์๊ฐํ์ง๋ง ์ด๊ฒ์ yarn์์ ์ฌ์ฉํ๋ ๊ธฐ๋ณธ ๋ ์ง์คํธ๋ฆฌ์ ๋๋ค (์ฌ์ ํ ์ญ๋ฐฉํฅ ํ๋ก์ ์ ๋๊น? ์๋ง ์ธ์ฆ ํค๋๋ฅผ ์กด์คํ์ง ์์ต๋๊น? ).
.npmrc
๋ฐ .yarnrc
ํ์ผ์ ์ญ์ / ์ด๋ํฉ๋๋ค.npm login
๋๋ yarn login
๋ฅผ ์คํํ์ฌ ์ธ์ฆ ํ ํฐ์ ์ฑ ์๋๋ค.0.27.5
์ดํ์ ์ ๋ฒ์ ์ ์ฌ์ฉํ์ฌ์ด ํจํค์ง๋ฅผ ์ค์นํด๋ณด์ญ์์ค.ํจํค์ง๊ฐ ์ฑ๊ณต์ ์ผ๋ก ์ค์น๋ฉ๋๋ค.
โค <strong i="26">@up</strong> โ REPO git:(master) โ
yarn add @SCOPE/PACKAGE
yarn add v1.1.0
info No lockfile found.
[1/5] Validating package.json...
[2/5] Resolving packages...
error An unexpected error occurred: "https://registry.npmjs.org/@SCOPE%2fPACKAGE: Not found".
info If you think this is a bug, please open a bug report with the information provided in "/home/katy/dev/REPO/yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.
ํ๋ก์ ํธ ๊ด๋ฆฌ์๊ฐ @kmoe ์ ์ง์นจ์ด ์ฌํ ๊ฐ๋ฅํ๋ค๊ณ ํ๋จ๋๋ฉด์ด ํฐ์ผ์ ๋ค์ ์ด์ด์ผํฉ๋๋ค (์ ์ด๋ ๊ธฐ์กด ๊ตฌ๋ ์๋ฅผ ์ํด).
@kmoe ๋์ํฉ๋๋ค. ์ต๊ทผ ๋ฒ์ ์ ์์ฌ์์๋ ๊ทผ๋ณธ์ ์ธ ๋ฌธ์ ๊ฐ ํด๊ฒฐ ๋์ง ์์์ต๋๋ค . ๋ฌธ์ ๋ฅผ ๋ค์์ฌ์ญ์์ค. ์, ํด๊ฒฐ ๋ฐฉ๋ฒ์ด ์์ง๋ง์ด ๊ฒฝ์ฐ ํด๊ฒฐ ๋ฐฉ๋ฒ! = ํด๊ฒฐ ๋ฐฉ๋ฒ์ ๋๋ค.
FWIW, ์ด๊ฒ์ 1.1.0์์ ์ฌ์ ํ ๋ฌธ์ ์
๋๋ค. ๋ฐฉ๊ธ ํ์ธํ์ต๋๋ค (ํด๊ฒฐ ๋ฐฉ๋ฒ์ ์ํด ์ฌ๊ธฐ๋ก ๋์ ์์ต๋๋ค. ์ฆ registry "https://registry.npmjs.org"
์ ์ถ๊ฐ๋๋ ~/.yarnrc
)
์์ฌ 1.3.2์์์ด ๋ฌธ์ ๊ฐ ๋ฐ์ํ๊ณ ์์ผ๋ฉฐ ํ์ฌ ๋น๋๊ฐ ์์๋๊ณ ์์ต๋๋ค. 0.27.5 ์ค์์ ์ ์๋ํ์ต๋๋ค.
Artifactory ๋น๊ณต๊ฐ ๋ ์ง์คํธ๋ฆฌ์์ ํจํค์ง๋ฅผ ์ค์นํ๋ ค๋ฉด .npmrc
ํ์ผ์ ์ธ์ฆ ํ ํฐ์ด ํ์ํฉ๋๋ค.
๋ณต์ ๋จ๊ณ :
.npmrc
ํ์ผ์ด ์์ต๋๋ค.registry=https://artifactory.mycompany.com/artifactory/api/npm/npm-virtual
_auth = myAuthTokenHere
always-auth = true
email = [email protected]
yarn install
error An unexpected error occurred: "https://artifactory.mycompany.com/api/npm/npm-virtual/@angular/compiler/-/compiler-4.3.1.tgz: Request failed \"401 Unauthorized\"".
๊ด๋ จ : # 4672
@stewx 1.3.2์์๋ ๋์ผํ ๋ฌธ์ ๊ฐ ๋ฐ์ํฉ๋๋ค. ํด๊ฒฐ ๋ฐฉ๋ฒ์ด๋ ํด๊ฒฐ ๋ฐฉ๋ฒ์ ์ฐพ์์ต๋๊น?
@jamesone ์๋์, 0.27๊ณผ ๊ฐ์ ๊ฒ์ผ๋ก ๋ค์ด ๊ทธ๋ ์ด๋ํ์ต๋๋ค. ๊ทธ๊ฒ์ ์ฐ๋ฆฌ ํ๋ก์ ํธ์ ๊ฑฐ๋๋ฅผ ๊นจ๋จ๋ฆฌ๋ ์์์ ๋๋ค.
ํธ์ ๋ด์ ๊ฐ๊ธฐ
.yarnrc์ registry "https://registry.npmjs.org"
์ ์ถ๊ฐํ๊ณ ๊ฐ์ธ ํจํค์ง๋ฅผ ๋ค์ ์ค์นํ์ญ์์ค.
yarn์๊ฒ npmjs ๋ ์ง์คํธ๋ฆฌ์ ์ง์ ์์
ํ๋๋ก ์ง์ํ๊ณ ๋ฌธ์ ๋ฅผ ํด๊ฒฐํฉ๋๋ค.
์ด ๋ฌธ์ ๋ฅผ ์ฐํํ๊ธฐ ์ํด 0.27.5 ์์ ๋ฒ์ ์ ๊ธ์ด ๋๋ฌด ์๋ชป๋์๋ค๊ณ ์๊ฐํ์ง๋ง ๋ง์ ์ฌ๋๋ค์ด registry
๊ตฌ์ฑ์ ๋ฆฌ๋๋ ์
ํ๋ _or_ ์์
์ ์ํํ๋ ๊ฒ์ฒ๋ผ ๋ณด์
๋๋ค ( @stewx ๊ฐ ์์ฒด ํธ์คํ
๋ฌธ์ ๋ฅผ ํด๊ฒฐํ์ง ๋ชปํจ์๋ณด๊ณ ํ์ง๋ง ๊ฐ์ธ ๋ ์ง์คํธ๋ฆฌ).
๋น๋ฒํ ํ๋ก์ ํธ ๊ธฐ์ฌ์๊ฐ ๋จ๊ธฐ๊ฐ์์ด ๋ฌธ์ ๋ฅผ ํด๊ฒฐํ ์๊ฐ์ด ์๋ค๋ฉด ๋๊ตฐ๊ฐ ์ปค๋ฎค๋ํฐ PR์ด ์ด๋ฆฌ๊ธฐ๋ฅผ ๋ฐ๋ผ๋ฉด์ ์์ ์ด ์ฑ๊ณตํ ๊ฐ๋ฅ์ฑ์ด ๊ฐ์ฅ ๋์ ์ฝ๋๋ฒ ์ด์ค ์์น๋ฅผ ๊ธฐ๊บผ์ด ์ ์ํ ๊น์? ๐ค
/ cc @kittens @bestander @BYK @arcanis @ rally25rs @kaylieEB
@Bnaya ์ฌ์ค์น๋ผ๊ณ ํ๋ฉด ํ๋ก์ ํธ์์ node_modules
๋ฅผ ์ ๊ฑฐํ๊ฑฐ๋ ์์ฌ ์บ์๋ฅผ ์ง์ฐ๋ ๊ฒ์ ์๋ฏธํฉ๋๊น?
์ ์ฌ๋ yourprivatepackage๋ฅผ ์ ๊ฑฐํฉ๋๋ค. ์์ฌ ์ถ๊ฐ yourprivatepackage
๊ทธ๋ฆฌ๊ณ ์ ๊ธ ํ์ผ์ https://registry.yarnpkg ***
์๋ https://registry.npmjs.org/***
url์ด ํ์๋ฉ๋๋ค.
package.json ์์ .yarnrc๋ฅผ ์ถ๊ฐํ๋ ๊ฒ์ด ์ข์ต๋๋ค.
์ค์ ๋ก registry "https://registry.npmjs.org"
๋ฅผ ~/.yarnrc
์ ๋ฃ์ด์ ์๋ํ๋๋ก ๋ง๋ค์์ต๋๋ค. ์ฆ, ํจํค์ง ๋ก์ปฌ .yarnrc
ํ์ํ์ง ์์ต๋๋ค.
๋๋ฅผ ์ํด ์ค๋ฅ๋ฅผ ์ฌํํ๋ ๋จ๊ณ :
~/.yarnrc
์์์ ์ธ๊ธ ํ๋๋ก ~/.yarnrc
๋ฅผ ์์ ํ๋ฉด ๋จ๊ณ์์ ์ค๋ฅ๊ฐ ๋ฐ์ํ์ง ์์ต๋๋ค.
์คํจํ ํ๋ก์ ํธ๋ฅผ ์ดํด๋ณด๋ฉด yarn.lock
์ https://registry.yarnpkg.com/@myscope/mypackage/
ํฌํจ๋์ด ์์์ ์ ์ ์์ต๋๋ค. ์ด๋ฌํ ํ๋ก์ ํธ๋ฅผ ์๋ ์ํค๋ ค๋ฉด ./.yarnrc
์
๋ฐ์ดํธ ํ ํ yarn.lock
๋ฅผ ์ ๊ฑฐํ๊ณ ๋ค์ ์์ฑํด์ผํฉ๋๋ค.
์ด๊ฒ์ ์ด๋ค ์ฌ๋๋ค์ด ๋ค๋ฅธ ์ฌ๋๋ค์๊ฒ ํจ๊ณผ๊ฐ์๋ ๊ฒ์ ์๋ํ๋๋ผ๋ ์ฌ์ ํ ์ค๋ฅ๊ฐ์๋ ์ด์ ๋ฅผ ์ค๋ช ํ๋ ๊ฒ ๊ฐ์ต๋๋ค.
registry "https://registry.npmjs.org"
์ถ๊ฐyarn.lock
์ ๊ฑฐ ๋ฐ ์ฌ์์ฑ@TheLudd ์ฒ์๋ถํฐ ๋ฌด๋ ์ง๋๋ค.
๋์ , ํ๋ก์ ํธ ๊ด๋ฆฌ์๋ ํ์ฌ ์ ๊ธ ํ์ผ ์ํ๋ฅผ ์ ์งํ๋ฉด์ yarnpkg.com
์์ npmjs.org
๊ฒ์ / ๋ฐ๊พธ๊ธฐ๋ฅผ ๊ณ ๋ คํ ์ ์์ต๋๋ค.
@awkaiser ๊ธ์, ๋น์ ์ ํ
์คํธ๊ฐ ํต๊ณผํ๋ ํ ๋น์ ์ ๊ทธ๊ฒ์ ์ปค๋ฐ ํ ์ ์๊ณ ๋ค๋ฅธ ๋ชจ๋ ํ๋ ฅ์๋ค์ ๋น์ ๊ณผ ๊ฐ์ ํ๊ฒฝ์ ๊ฐ๊ฒ ๋ ๊ฒ์
๋๋ค. ๊ทธ๋์ ๊ทธ ๋ชฉ์ IMO๋ฅผ ์ค์ ๋ก ๊บพ์ง ์์ต๋๋ค.
ํ์ง๋ง ๋ค, ๊ฒ์ ๊ต์ฒด๋ ๊ฐ๋ฅํฉ๋๋ค.
๊ทธ๋ฌ๋ ๊ท์น์ ๋ํ ์๋์ผ๋ก yarn.lock์ ์์ ํด์๋ ์๋๋ค๋ ๊ฒ์ ๋๋ค.)
package.json ์๊ตฌ ์ฌํญ์ ์ถฉ์กฑํ๋ ์ ๋ ์ต์ ํจํค์ง๋ฅผ ๊ฐ์ ธ ์ค๋ ๊ฒ์ด ํญ์ ์์ ํ๋ค๋ฉด ์ ๊ธ ํ์ผ์ด ์ ํ ํ์ํ์ง ์์ ๊ฒ์ ๋๋ค. ๐
์ผ๋ฐ์ ์ผ๋ก ์, ์ฐ๋ฆฌ๋ ์ง์ yarn.lock ์ ์์
์ ์ฒด ์ ๊ธ ํ์ผ์ ๋ค์ ์์ฑ ํ ํ์๊ฐ ์์์ต๋๋ค.
๊ฐ์ธ ํจํค์ง๋ฅผ ์ ๊ฑฐํ๊ณ ์ค์นํ๊ธฐ ์ํด
@awkaiser ๋๋ ์ค๋ ๋์ ๋ค๋ฅธ ์ฌ๋-๋น์ ์ด ๋์ธ ์์๋ ํ ๊ฐ์ง ๋ฐฉ๋ฒ์ ์ฌํ ๊ฐ๋ฅํ ์์ ๋ฅผ ๋ง๋๋ ๊ฒ์
๋๋ค. ์๋ฅผ ๋ค์ด์ด repo https://github.com/KidkArolis/yarn-scopes-issue๋ฅผ ๊ธฐ๋ฐ์ผ๋กํฉ๋๋ค yarn
์ด ์คํจํ๋ ๋ฆฌํฌ์งํ ๋ฆฌ๋ฅผ ์์ฑ ํ ์ ์๋ค๋ฉด (ํน์ ๋ ์ง์คํธ๋ฆฌ ์๋ต, ํน์ ์ ๊ตฌ์ฑ, ํน์ package.json ๋ฑ) ๋ฌธ์ ํด๊ฒฐ์ ํ์คํ ์ดํด๋ณผ ์ ์์ต๋๋ค.
์ผ๋ฐ์ ์ผ๋ก:
.yarnrc
ํ์ผ์ด ํ์ํ์ง ์์ต๋๋ค..yarnrc
ํฌํจ registry "https://registry.npmjs.org"
registry.npmjs.org
๋น๊ณต๊ฐ ๋ชจ๋์ด ์๋ํฉ๋๋ค.custom.registry.org
๋น๊ณต๊ฐ ๋ชจ๋์ด ์๋ํฉ๋๋ค.@KidkArolis ์คํจ๋ ๋ฌด์์์
๋๋ค. ๊ทธ๋ฌ๋ ๊ทธ๋ค์ ๊ฑฐ๊ธฐ์ ์์ต๋๋ค.
๋ด๊ฐ ๋ค๋ฅธ ๊ด๋ จ ๋ฌธ์ ์ ๋ํด ์ผ ๋ฏ์ด ์์ฌ ๋ ์ง์คํธ๋ฆฌ ๋ฌธ์ (์บ์ฑ ์คํจ, ํ๋ก์์ ์๋ชป๋ Vary ํค๋, ๋ฌด์์ด๋ ) ๋๋ ์์ฌ ๋ ์ง์คํธ๋ฆฌ์์๋ง ๋ฐ์ํ๋ ์์ฌ ๋ด๋ถ์ ๋ณต์กํ ๊ฐ์ฅ์๋ฆฌ ์ผ์ด์ค.
@kmoe ๊ฐ 2017 ๋ 9 ์ 25 ์ผ์ ์ด ๊ธ์ด ๋ถ์กฑํ๊ฐ์? ๐ค
์ด ๋ฌธ์ ์ ์ฌ๊ฐ๋ฅผ ์ด๊ตฌํ์ผ๋ฉฐ, ์ด๋ ๊ธฐ์ฌ์์ ์ํ ๋ณต์ ๋ฅผ ์๋ฏธํฉ๋๋ค.
@KidkArolis ๊ฐ์ธ ๋ชจ๋๊ณผ ๊ด๋ จ์ด ์๊ณ ๋ฐ๋ผ์ ๋๊ฐ ์์ ์คํํ๋์ง์ ๋ฐ๋ผ ๋ค๋ฅด๊ธฐ ๋๋ฌธ์ ๋ฆฌํฌ์งํ ๋ฆฌ์์ ์ฌํ ๊ฐ๋ฅํ ์์ ๋ฅผ ์ด๋ป๊ฒ ๋ง๋ค ์ ์๋์ง ์ ๋ชจ๋ฅด๊ฒ ์ต๋๋ค. ๊ทธ๋ฌ๋ ์ค๋ฅ๋ฅผ ์ฌํํ๋ ๋จ๊ณ๋ ์ฌ๊ธฐ https://github.com/yarnpkg/yarn/issues/4451#issuecomment -355248563์ด๋ฉฐ @kmoe๊ฐ ์์ฑํ ๋ด์ฉ์ผ๋ก๋ ์ถฉ๋ถํฉ๋๋ค.
.yarnrc
์์ ํ์ง ์๊ณ ๊ฐ์ธ ํจํค์ง๋ฅผ ์ค์นํ๋ ค๊ณ ํ๋ฉด ์ค๋ฅ๊ฐ ๋ฐ์ํฉ๋๋ค.
์๊ธฐ์น ์์ ์ค๋ฅ๊ฐ ๋ฐ์ํ์ต๋๋ค : " https://registry.yarnpkg.com
์ด๊ฒ์ npm์ด ์๋ yarn ๋ ์ง์คํธ๋ฆฌ์์ ๊ฒ์๋๋ค๋ ๊ฒ์ ์๋ฏธํฉ๋๋ค. ์ด ๋ฒ๊ทธ๋ฅผ ์ผ์ผํค๋ ์ค๋ฅ๊ฐ ์๋๋๊น?
์ข์ต๋๋ค. ์ฌ์์ฐ ๋จ๊ณ๋ฅผ ์ฌ ํฌ์ฅ ํด ์ฃผ์ ์ ๊ฐ์ฌํฉ๋๋ค. ๋๋ ์๋ํ๊ณ ๋ณผ ๊ฒ์ด๋ค.
์ด๋ค ์ด์ ๋ก ๋ ์ด ๋ช ์ ์ ์์น๋ฅผ .npmrc์ ์ถ๊ฐํ์ฌ ๋ด ๊ฐ์ธ ํจํค์ง๋ฅผ ์ฐพ์ ์์น๋ก ์ธํด ๋ฌธ์ ๋ฅผ ์ผ์ผํค๋ ๋ชจ๋ ์ ์ฅ์์์ 404 ์ค๋ฅ๊ฐ ๋ฐ์ํ์ง ์๊ฒ๋์์ต๋๋ค.
@npm-username:registry=https://registry.yarnpkg.com/
๋๊ตฌ๋ ์ง ๋๋ฅผ ์ถ๊ฐ ํ ์์๋ ๋น๊ณต๊ฐ npm ํจํค์ง๊ฐ ์์ต๋๊น? ์ฌ์ฉ์ ์ด๋ฆ : kidkarolis
.
์ ๋ฃ ๊ณ์ ์ ์ป๊ธฐ ์ํด ๊ณ ๊ตฐ๋ถํฌํ๊ณ ์์ต๋๋ค. ๊ฒฐ์ / ๊ณ์ ์์คํ
์ด atm์์ ์๋ํ์ง ์๋ ๊ฒ ๊ฐ์ต๋๋ค (๋น์ฉ์ด ์ฒญ๊ตฌ๋์์ง๋ง 402 Payment Required
๋ฅผ๋ฐ์ต๋๋ค. ๋๊ตฐ๊ฐ ๋๋ฅผ ๊ฐ์ธ ํจํค์ง์ ์ถ๊ฐํ๋ฉด (๊ฐ๋ฅํ๋ค๋ฉด) ์๋๊ฐ ๋นจ๋ผ์ง ๊ฒ์
๋๋ค.
์ข์, ๋๋ ๊ทธ๊ฒ์ด ๋จ์ง .. ์ต์ข ์ผ๊ด์ฑ์ด๋ผ๊ณ ์๊ฐํ๋ค. ๋์ ๊ฐ์ธ npm ๊ณ์ ์ ์ด์ ์๋ํ๋ค.
๊ทธ๋ฌ๋ ์์ง ๋ฌธ์ ๋ฅผ ์ฌํ ํ ์ ์์ต๋๋ค.
@kmoe๊ฐ ์ ๊ณต ํ ๋จ๊ณ๋ฅผ
rm ~/.yarnrc && rm ~/.npmrc
yarn cache clean && npm cache clean --force
npm login
yarn add @scope/pkg
๊ทธ๊ฒ์ ์ ์ค์น๋ฉ๋๋ค ( npm login
ํ์ง ์์ผ๋ฉด ์ค์น๋์ง ์์ต๋๋ค). ์ฆ, ์์๋๋ก ์๋ํฉ๋๋ค.
๊ทธ๋ฆฌ๊ณ yarn.lock์ผ๋ก ํ๋จํ๋ฉด ๋ด ์ค์น๊ฐ https://registry.yarnpkg.com
๊ฑฐ์น๊ณ ์์๋๋ก ์ธ์ฆ์ ์ฌ์ฉํ๋ ๊ฒ ๊ฐ์ต๋๋ค. ๊ณผ๊ฑฐ์ ์๋ฒ์ ๋ฌธ์ ๊ฐ ์์๋๋ฐ ์ด์ ํด๊ฒฐ ๋์๋์?
์ข์, ๋ญ๊ฐ๋ฅผ ์ฌํํ๋ค๊ณ ์๊ฐํฉ๋๋ค.
<strong i="6">@qubit</strong>:registry=https://registry.npmjs.org/
์ .npmrc
ํ๋ฉด ์ค์น๊ฐ ๋ ์ด์ ์๋ํ์ง ์์ต๋๋ค.
๋ ๋น์ ์ด ๋ก๊ทธ์ธํ๋ฉด ํด๋น ํ์ด ์ถ๊ฐ๋ฉ๋๋ค ์๊ฐ npm login --scope=@qubit
๋ฐฉ๊ธ ๋ก๊ทธ์ธ ๊ฒฝ์ฐ๋ ์ถ๊ฐ๋์ง ์์ต๋๋ค npm login
. ๋ค์์์ด ๋ฌธ์ ๋ฅผ ํด๊ฒฐํ๋ ๋ฐฉ๋ฒ์ ์ดํด ๋ณด๊ฒ ์ต๋๋ค.
@KidkArolis ํด๋น ๊ตฌ์ฑ์ ์ค์ ํ๋ ๋ค๋ฅธ ์ผ๋ฐ์ ์ธ ๋ฐฉ๋ฒ์ ๋ค์๊ณผ ๊ฐ์ต๋๋ค.
npm config set <strong i="8">@qubit</strong>:registry https://registry.npmjs.org
PR-# 5162 ํผ๋๋ฐฑ (๋๋ QA) ํ์ํฉ๋๋ค.
@KidkArolis PR์ ๊ฐ์ฌ๋๋ฆฝ๋๋ค. ๊ทธ๋ฌ๋ ๋ฌธ์ ๋ "--scope"๊ฒฝ์ฐ๋ฟ๋ง ์๋๋ผ ๊ฐ์ธ ์ ์ฅ์๊ฐ ์ธ์ฆ์ ์ฌ์ฉํ์ฌ ๊ณต๊ฐ ํจํค์ง๋ฅผ ๋ฏธ๋ฌ๋งํ๋๋ณด๋ค ์ผ๋ฐ์ ์ธ ๊ฒฝ์ฐ์๋ ์๋ค๊ณ ์๊ฐํฉ๋๋ค.
๊ทธ๊ฑด ๊ทธ๋ ๊ณ , @ bytheway875 , https://registry.yarnpkg.com/
๋ ์ง์คํธ๋ฆฌ๋ก ์ฌ์ฉํ๋ ํธ๋ฆญ์ด ์ ์๊ฒ ํจ๊ณผ์ ์ด์์ต๋๋ค.
๋ด ์ํฉ :
.npmrc
ํ์ผ์ authToken
๋ฅผ ์ฌ์ฉํ์ฌ npmjs.com์ ์กฐ์ง (@ org-name)์์ yarn
๋ก ๊ฐ์ธ ํจํค์ง๋ฅผ ์ค์นํฉ๋๋ค. ๊ทธ๋์ npm
๋ก๊ทธ์ธํ์ง ์์์ต๋๋ค.npm
npm login
๋ฐ yarn
๊ทธ๋ฅ ์๋ํ๊ฑฐ๋ npm์์ ๋ก๊ทธ ์์ ํ ์ ์์ง๋ง ์๋์ผ๋ก ๋ก์ปฌ / HOME dir .npmrc
ํ์ผ์ ๋ง๋ค ์ ์์ต๋๋ค. ํ ์ค : //registry.npmjs.org/:_authToken=token
๋ฐ yarn
๊ทธ๋ฅ ์๋ํฉ๋๋ค (๋ ๋ฒ์งธ ๋ฐฉ๋ฒ์ ๋ก์ปฌ ์บ์์ ์์ธ ์ผ ์ ์์ต๋๋ค. ์ญ์ ๋ฅผ ์๋ํ์ง ์์์ต๋๋ค)..yarnrc
ํธ๋ฆญ์ด ์๋ํ์ง ์์์ต๋๋ค._์ด ์์
์ ์ํ ํ ์์๋ ์ ์ผํ ๋ฐฉ๋ฒ์ CI์์ yarn install
๋ฅผ ์คํํ๊ธฐ ์ ์ ์๋ ๋ก์ปฌ .npmrc
ํ์ผ์ ๋ง๋๋ ๊ฒ์
๋๋ค ._
@org-name:registry=https://registry.yarnpkg.com/
always-auth=true
_authToken=token
.npmrc
ํ์ผ๊ณผ ๋น์ทํ ๋ฌธ์ ๊ฐ ์์ต๋๋ค. ๋ด๊ฐํด์ผ ํ ์ผ์ .npmrc
ํ์ผ์ ์ธ์ฝ๋ฉ์ ANSI๋ก ์ค์ ํ๋ ๊ฒ๋ฟ์
๋๋ค (Windows์์๋ notepad.exe> โโ๋ค๋ฅธ ์ด๋ฆ์ผ๋ก ์ ์ฅ ...์ ์ฌ์ฉํ ์ ์์ต๋๋ค).
yarn config list
์ฌ์ฉํ์ฌ yarn์ด .npmrc
ํ์ผ ์ฝํ
์ธ ๋ฅผ ๋ณด๋ ๋ฐฉ๋ฒ์ ํ
์คํธ ํ ์ ์์ต๋๋ค.
v1.4.1
์ ํจ๊ป ์๋ํ๋๋ก ํ ์ ์์ต๋๋ค. ๊ฐ์ธ Nexus ์ ์ฅ์๊ฐ ์์ผ๋ฉฐ ์บ์ / ํ๋ก์๋ก ์ฌ์ฉํฉ๋๋ค ( ์ด์ ๊ฐ์ด ). ํ์คํ ์ง์นจ์ ์ฐพ์ ์์๋ ๊ฒ ๊ฐ์์ ๋ด๊ฐ ๋ญ๊ฐ ์๋ชปํ๊ณ ์์ ์ ์์ต๋๋ค. ์ฌ๊ธฐ์๋ yarn config
๊ตฌ๋ฌธ์, ์ฌ๊ธฐ ์์๋ yarn login
๊ตฌ๋ฌธ์ ๊ฐ์ ธ ์์ต๋๋ค .
ํธ์ง : ๋๋ yarn
์๋ํ๊ธฐ ์ ์ ํ์ํ .npmrc
๋ฅผ ์ป๊ธฐ ์ํด NPM์ ํตํด ๋จผ์ ๋ก๊ทธ์ธ์ ์๋ํ๋ค๊ณ ์ธ๊ธ ํ์ด์ผํ์ต๋๋ค.
์๋๋ ์ ํํ ๋ด๊ฐ ํ ์คํธํ๋ ๊ฒ์ ๋๋ค.
git tag --contains dc705768
v1.4.0
v1.4.1
Dockerfile์ ์์ฑํ์ฌ ํ ์คํธ๋ฅผ์ํ ์ผ๊ด๋ ๊ธฐ์ค ํ๊ฒฝ์ ์ ๊ณตํฉ๋๋ค.
# Build
# docker build -t yarn-private-registry-test .
# Run
# docker run -it --rm yarn-private-registry-test
FROM debian:9.3-slim
WORKDIR /projects
RUN apt-get update \
&& apt-get --yes install curl gnupg \
&& curl -sL https://deb.nodesource.com/setup_8.x | bash - \
&& apt-get install --yes nodejs \
&& curl -OL https://github.com/yarnpkg/yarn/releases/download/v1.4.1/yarn_1.4.1_all.deb \
&& find . -name yarn*.deb -exec dpkg --install {} \; \
&& find . -name yarn*.deb -exec rm {} \;
docker build -t yarn-private-registry-test .
ํํธ : ๊นจ๋ํ ํ๊ฒฝ์ ์ป์ผ๋ ค๋ฉด Docker ์ปจํ ์ด๋๋ฅผ ๊ณ์ ์ข ๋ฃํ๊ณ ๋ค์ ์์ํ์ญ์์ค.
๊ตฌ์ฑ์ ๋ณ๊ฒฝํ์ง ์๊ณ ํ๋ก์ ํธ๋ฅผ ์ด๊ธฐํํ๊ณ ์ข ์์ฑ์ ์ถ๊ฐํ์ฌ ํ๊ฒฝ์ด ์๋ํ๋์ง ํ์ธํฉ๋๋ค.
docker run -it --rm yarn-private-registry-test
left-pad
์ข
์์ฑ์ ์ถ๊ฐํฉ๋๋ค.
mkdir yarn \
&& cd yarn \
&& yarn init --yes \
&& yarn add left-pad
yarn init v1.4.1
warning The yes flag has been set [...snip...]
success Saved package.json
Done in 0.03s.
yarn add v1.4.1
info No lockfile found.
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Saved lockfile.
success Saved 1 new dependency.
โโ [email protected]
Done in 0.52s.
docker run -it --rm yarn-private-registry-test
mkdir yarn \
&& cd yarn \
&& yarn init --yes \
&& yarn config set registry https://example.com/repository/npm-group/ \
&& yarn login
yarn init v1.4.1
warning The yes flag has been set [...snip...]
success Saved package.json
Done in 0.03s.
yarn config v1.4.1
success Set "registry" to "https://example.com/repository/npm-group/".
Done in 0.04s.
yarn login v1.4.1
question npm username: myusername
question npm email: [email protected]
Done in 6.25s.
left-pad
์ข
์์ฑ์ ์ถ๊ฐํฉ๋๋ค.
yarn --verbose add left-pad
yarn add v1.4.1
verbose 0.349 Checking for configuration file "/projects/yarn/.npmrc".
verbose 0.35 Checking for configuration file "/usr/local/share/.npmrc".
verbose 0.35 Checking for configuration file "/usr/etc/npmrc".
verbose 0.352 Checking for configuration file "/root/.npmrc".
verbose 0.353 Checking for configuration file "/projects/yarn/.npmrc".
verbose 0.353 Checking for configuration file "/projects/.npmrc".
verbose 0.355 Checking for configuration file "/projects/yarn/.yarnrc".
verbose 0.355 Checking for configuration file "/usr/local/share/.yarnrc".
verbose 0.357 Found configuration file "/usr/local/share/.yarnrc".
verbose 0.358 Checking for configuration file "/usr/etc/yarnrc".
verbose 0.358 Checking for configuration file "/root/.yarnrc".
verbose 0.359 Checking for configuration file "/projects/yarn/.yarnrc".
verbose 0.359 Checking for configuration file "/projects/.yarnrc".
verbose 0.365 current time: 2018-01-25T21:55:48.886Z
info No lockfile found.
verbose 0.405 Performing "GET" request to "https://yarnpkg.com/latest-version".
[1/4] Resolving packages...
verbose 0.48 Performing "GET" request to "https://example.com/repository/npm-group/left-pad".
verbose 0.52 Request "https://example.com/repository/npm-group/left-pad" finished with status code 401.
verbose 0.522 Error: Couldn't find package "left-pad" on the "npm" registry.
at new MessageError (/usr/share/yarn/lib/cli.js:186:110)
at NpmResolver.<anonymous> (/usr/share/yarn/lib/cli.js:50354:15)
at Generator.next (<anonymous>)
at step (/usr/share/yarn/lib/cli.js:98:30)
at /usr/share/yarn/lib/cli.js:109:13
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:188:7)
error An unexpected error occurred: "Couldn't find package \"left-pad\" on the \"npm\" registry.".
info If you think this is a bug, please open a bug report with the information provided in "/projects/yarn/yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.
verbose 0.809 Request "https://yarnpkg.com/latest-version" finished with status code 200.
.yarnrc
cat /usr/local/share/.yarnrc
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1
registry "https://example.com/repository/npm-group/"
email [email protected]
lastUpdateCheck 1516917349331
username myusername
์๋ํ๋ฏ๋ก ์ํ๋ ๊ตฌ์ฑ์ผ๋ก ๋ฐ๋ก ๊ฑด๋ ๋๋๋ค.
docker run -it --rm yarn-private-registry-test
mkdir npm \
&& cd npm \
&& npm init --yes \
&& npm config set registry https://example.com/repository/npm-group/ \
&& npm login
Wrote to /projects/npm/package.json:
{
"name": "npm",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC"
}
Username: myusername
Password:
Email: (this IS public) [email protected]
Logged in as myusername on https://example.com/repository/npm-group/.
left-pad
์ข
์์ฑ์ ์ถ๊ฐํฉ๋๋ค.
npm --verbose install left-pad
npm info it worked if it ends with ok
npm verb cli [ '/usr/bin/node',
npm verb cli '/usr/bin/npm',
npm verb cli '--verbose',
npm verb cli 'install',
npm verb cli 'left-pad' ]
npm info using [email protected]
npm info using [email protected]
npm verb npm-session 0ed36c84804378c8
npm http fetch GET 200 https://example.com/repository/npm-group/left-pad 78ms
npm http fetch GET 200 https://example.com/repository/npm-group/left-pad/-/left-pad-1.2.0.tgz 28ms
npm verb correctMkdir /root/.npm/_locks correctMkdir not in flight; initializing
npm verb makeDirectory /root/.npm/_locks creation not in flight; initializing
npm verb lock using /root/.npm/_locks/staging-2f9f45630e5bbb1a.lock for /projects/npm/node_modules/.staging
npm info lifecycle [email protected]~preinstall: [email protected]
npm info linkStuff [email protected]
npm verb linkBins [email protected]
npm verb linkMans [email protected]
npm info lifecycle [email protected]~install: [email protected]
npm info lifecycle [email protected]~postinstall: [email protected]
npm verb unlock done using /root/.npm/_locks/staging-2f9f45630e5bbb1a.lock for /projects/npm/node_modules/.staging
npm verb saving [ { name: 'left-pad', spec: '^1.2.0', save: 'dependencies' } ]
npm info lifecycle undefined~preshrinkwrap: undefined
npm info lifecycle undefined~shrinkwrap: undefined
npm notice created a lockfile as package-lock.json. You should commit this file.
npm info lifecycle undefined~postshrinkwrap: undefined
npm WARN [email protected] No description
npm WARN [email protected] No repository field.
+ [email protected]
added 1 package in 0.398s
npm verb exit [ 0, true ]
npm info
@ryanjaeb ์์ธํ ๋ณด๊ณ ์๋ฅผ ๋ณด๋ด ์ฃผ์
์ ๊ฐ์ฌํฉ๋๋ค. ์ฌ๊ธฐ์์ ๋ฌด์์ด ์๋ชป ๋ ์ ์๋์ง ์๋ ค ๋๋ฆฌ๊ธฐ ์ํด ์ ๊ฐ ๋์น ๊ฒ์ ~/.npmrc
๋ฐ ~/.yarnrc
ํ์ผ์ ๋ด์ฉ์
๋๋ค. .yarnrc
๋ถ์ฌ ๋ฃ์์ง๋ง ๋น๋ฐ๋ฒํธ๊ฐ ํฌํจ๋์ด ์์ง ์์ต๋๋ค. ๋ํ ๋น๊ต๋ฅผ ์ํด .npmrc
ํ์ผ์ด ์์ผ๋ฉด ๋ฌธ์ ๋ฅผ ์ ํํ ์ง์ ํ๊ธฐ๊ฐ ์ด๋ ต์ต๋๋ค.
์ฌ์ฉ ์ฌ๋ก๋ ^ 1.4.0์์ ์ ์๋ํ์ง๋ง ๊ตฌ์ฑ ํ์ผ์ด ์ด๋ป๊ฒ ๋ณด์ด๋์ง์ ๊ดํ ๊ฒ์ ๋๋ค.
๋น์ ๊ณผ ํจ๊ป Tbh, ๋๋ yarn login
์ฌ์ฉํ์ง ์๊ณ ๋จผ์ npm login
์ ์ฌ์ฉํ ๋ค์ yarn
ํฉ๋๋ค. ๋น์ ์ ์์ ์์์, ๋จผ์ ํ ๊ฒฝ์ฐ npm set config registry ... && npm login
๋ค์ ์คํ add left-pad
- ๊ทธ๊ฒ์ ์๋ํฉ๋๊น? npm์ด ์๋ํ๋ฉด ์ค๋ ๋ง์ฐฌ๊ฐ์ง์
๋๋ค. ๊ทธ๋์ yarn login
๋ช
๋ น์ด ๊นจ ์ก๋์ง ๊ถ๊ธํฉ๋๋ค.
๋ฌด์ @KidkArolis yarn login
ํ๊ณ ์ ์๊ธฐ๋ฅผ ๊ธฐ๋ ๊ทธ๊ฒ์ ๋จ์ง ์์
์ ์ป์ npm login
, ๋๋ ์ฝ๊ฐ์ ์ง์ ์ ํ ์ ์์๋ค. ๋๋ ๋ ๊ฐ์ง๋ฅผ๋ณด๊ณ ์๋ค.
.npmrc
npm-login์ ๋ํ ๋ฌธ์๊ฐ ์ค์ ๋ก .npmrc
์์ ๋ณด๋ ๊ฒ๊ณผ ์ผ์นํ์ง ์๋ ๊ฒ ๊ฐ์ต๋๋ค. ํนํ npm login
๋ช
๋ น์ ๋ํ --always-auth ์ธ์๋ ๋ฌธ์์์ ๋ค์๊ณผ ๊ฐ์ด ๋งํ๋๋ผ๋ ๊ตฌ์ฑ์ ์ํฅ์์ฃผ์ง ์์ต๋๋ค.
--registry ๋ฐ / ๋๋ --scope์ ํจ๊ป ์ฌ์ฉํ ์ ์์ต๋๋ค.
...
always-auth์ ๋ ์ง์คํธ๋ฆฌ ๋ณ ๊ตฌ์ฑ์ ๋ชจ๋ ์ ์ญ ๊ตฌ์ฑ๋ณด๋ค ์ฐ์ ํฉ๋๋ค.
๊ทธ๋ฌ๋ ํด๋น ์ธ์๋ฅผ ์ฌ์ฉํ๋์ง ์ฌ๋ถ์ ๊ด๊ณ์์ด ํญ์ ๋์ผํ .npmrc
๋๋ฉ๋๋ค. ์์ ๋ชจ๋:
npm config set registry https://example.com/repository/npm-group/ \
&& npm login --registry=https://example.com/repository/npm-group/
๊ณผ
npm config set registry https://example.com/repository/npm-group/ \
&& npm login --registry=https://example.com/repository/npm-group/ --always-auth
.npmrc
:
registry=https://example.com/repository/npm-group/
//example.com/repository/npm-group/:_authToken=NpmToken.XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
๋ด ๋ ์ง์คํธ๋ฆฌ๋ก ์ด๋ํ๋ ํธ๋ํฝ์ ์ค๋ํํ๋ฉด NPM์ด ๋ค์๊ณผ ์๊ด์์ด ์ธ์ฆ ํ ํฐ์ ๋ณด๋ธ๋ค๋ ๊ฒ์ ๋ณด์ฌ์ค๋๋ค.
GET /repository/npm-group/left-pad HTTP/1.1
Host: example.com
user-agent: npm/5.6.0 node/v8.9.4 linux x64
npm-in-ci: false
npm-scope:
npm-session: c4c14c0b37be7bd5
referer: install left-pad
pacote-req-type: packument
pacote-pkg-id: registry:manifest
accept: application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*
authorization: Bearer NpmToken.XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
accept-encoding: gzip,deflate
X-Forwarded-Proto: https
X-Forwarded-For: 10.10.10.1
X-Forwarded-Host: example.com
X-Forwarded-Server: example.com
Connection: Keep-Alive
Yarn์ always-auth
๊ฐ ์ค์ ๋์ด ์์ง ์์ผ๋ฉด ํ ํฐ์ ๋ณด๋ด์ง ์์ต๋๋ค . .npmrc
์์ always-auth
ํ๋๊ทธ๋ฅผ ๋ช
์ ์ ์ผ๋ก ์ค์ ํ๋ฉด ๋ชจ๋ ๊ฒ์ด ์์๋๋ก ์๋ํฉ๋๋ค.
npm config set always-auth true \
&& cat ~/.npmrc
registry=https://example.com/repository/npm-group/
//example.com/repository/npm-group/:_authToken=NpmToken.XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
always-auth=true
NPM๊ณผ Yarn ์ฌ์ด์ ๋์์ด ๋ค๋ฅด๋ค๋ ๊ฒ์ ์๋ ๊ฒ ์ธ์๋ ์ด๋ค ๋์์ด ์ฌ๋ฐ๋ฅธ์ง ์๊ธฐ์ ์ถฉ๋ถํ ์ต์ํ์ง ์์ต๋๋ค.
yarn login
์๋ํ์ง ์๋ yarn login
์ ๋ํด ์ณ๋ค๊ณ ์๊ฐํ์ง๋ง ๊ด๋ฒ์ํ๊ฒ ํ
์คํธํ์ง๋ ์์์ต๋๋ค. .npmrc
๋ฌด์ํ๊ณ yarn
๋ง ์ฌ์ฉํ์ฌ NPM ๊ตฌ์ฑ์ ๋ชจ๋ฐฉํ๋ ค๊ณ ํฉ๋๋ค.
yarn config set registry https://example.com/repository/npm-group/ \
&& yarn config set always-auth true \
&& yarn login
.yarnrc
:
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1
registry "https://example.com/repository/npm-group/"
always-auth true
email [email protected]
lastUpdateCheck 1517883362958
username myusername
๋ด๊ฐ ๋ฌด์์ํ๋ ๋ด ๋น๋ฐ๋ฒํธ๋ฅผ ์ ๋ ฅํ๋ผ๋ ๋ฉ์์ง๊ฐ ํ์๋์ง ์์ต๋๋ค.
@KidkArolis ๋๋ฅผ ์ํด npm์ always-auth=true
์์ด ์๋ํ๊ณ yarn (1.3.2 ๋๋ 1.4.0)์ ๊ทธ๋ ์ง ์์ต๋๋ค. ์ ๊ฒฝ์ฐ์๋ ๋ชจ๋ ์์ฒญ์ ์ํฐ ํฉํ ๋ฆฌ์ ๊ฐ์ ๋ ์ง์คํธ๋ฆฌ๋ก ์ง์ ํ๋ ค๊ณ ํฉ๋๋ค. .npmrc์์ always-auth=true
๋ฐ authToken
โ 1.3.2
์์ ์๋ํ๋ฏ๋ก 1.4.0
์์ ์ ํํ ๋ฌด์์ด ์์ ๋์๋์ง ๋ช
ํํ์ง ์์ต๋๋ค.
์ด๊ฒ์ ์ฌ์ ํ โโ๋ฌธ์ ์ธ ๊ฒ ๊ฐ์ต๋๋ค. ํนํ Nexus ์ ์ฅ์์ ์ฐ๊ฒฐ๋ฉ๋๋ค.
๋ช ๊ฐ์ง ์ ๊ทผ ๋ฐฉ์์ ์๋ํ์ต๋๋ค.
~/.yarnrc
์์ ํ์ ์ด๋ค์๋ง ์์กด ~/.npmrc
.~/.yarnrc
๋ ์ง์คํธ๋ฆฌ ์ค์ ์ ๋ํด ์์ ๋ด
๋๋ค.์ด๋ ์์ ํด์ ์ฌ์ฉํ์ง ์๋ ๊ฒ _auth
๊ฐ (์๋ฅผ ๋ค์ด _auth=xyz
)์์ ~/.npmrc
NPM
npm --version
5.6.0
์ค
yarn --version
1.5.1
OS X 10.13.2์์ ์คํ ์ค์ ๋๋ค.
๋ด ~/.npmrc
์ ๋ค์๊ณผ ๊ฐ์ต๋๋ค (๋ช
๋ฐฑํ ์ด์ ๋ก ์ผ๋ถ ์ค์ _values_ ์๋ต).
registry=http://nexus-repo:8081/content/repositories/npm-all
init.author.name=Juan Smith
[email protected]
init.author.url=http://nexus-repo:8081/content/repositories/npm/
[email protected]
_auth=BASE64-HASH-USERNAME-PASSWORD
always-auth=true
๋ด ~/.yarnrc
์ ๋ค์๊ณผ ๊ฐ์ต๋๋ค (๋ค์ ํ ๋ฒ ๋ถ๋ช
ํ ๊ฐ์ ์๋ต ๋จ).
registry "http://nexus-repo:8081/content/repositories/npm-all//"
email [email protected]
lastUpdateCheck 1521495247797
username jsmith
์ฌ๊ธฐ์ ์ด๋๋ก ๊ฐ์ผํ ์ง ๋ชจ๋ฅด๊ฒ ์ต๋๋ค. ๋ชจ๋ ์์ฌ ๋น๋๊ฐ ๋ค์๊ณผ ๊ฐ์ ๋ฐฉ์์ผ๋ก ์คํจํ๋ค๋ ์ ์ ์ ์ธํ๊ณ ๋ ๋ฌด์จ ์ผ์ด ์ผ์ด๋๊ณ ์๋์ง ์์ ํ ๋ช ํํ์ง ์์ต๋๋ค.
error An unexpected error occurred: "http://nexus-repo:8081/content/groups/npm-all/lru-cache/-/lru-cache-4.1.2.tgz: Request failed \"401 Unauthorized\"".
FWIW, IANADOE (I Am Not A Dev Ops Engineer)๋ ์ ์ ๋น๋๋ฅผ ์ํด ์์ฌ์ ์์งํ๋ ํจํค์ง๋ฅผ ํ์ฉํ๋ ค๊ณ ํฉ๋๋ค. ์ด๊ฒ์ ์์ฌ์ ๋ํด base64
username | password ํด์๋ฅผ ์ค์ ํ๋ ๋ฐฉ๋ฒ์ ๋ชจ๋ฅผ ์ ์์ต๋๋ค. ๋๋ ๊ทธ๊ฒ์ ์ค๋ช
ํ๋ ๋ฌธ์๋ฅผ ์ฐพ์ ์ ์์๋ค.
@ezweave Sonatype์ ์ ๋ง ์ข์ ๋ฌธ์๋ฅผ ๊ฐ์ง๊ณ npm Bearer Token Realm ์ ํ์ฑํํ๊ณ ์ํฌ ์คํ
์ด์
์์ npm login
๋ฅผ ์ฌ์ฉํ๋ ๊ฒ์ด ๊ฐ์ฅ ์ฝ์ต๋๋ค. ์ ์:
npm config set registry http://nexus-repo:8081/content/repositories/npm-all
npm login --registry=http://nexus-repo:8081/content/repositories/npm-all --always-auth
npm config set always-auth true
Yarn์ ์๋ํ๊ธฐ ์ ์ NPM์์ ์๋ํ๋์ง ํ์ธํ์ญ์์ค. ์ค์ํ์ง ๋ชจ๋ฅด๊ฒ ์ง๋ง .yarnrc
๋ ์ง์คํธ๋ฆฌ์ ๋ ๊ฐ์ ํํ ์ฌ๋์ ( //
)๊ฐ ์์ต๋๋ค.
@ryanjaeb ๊ทธ๋์ ์ฐ๋ฆฌ devops ํ์ _only_ LDAP Realm์ ์ง์ํ๋๋ก Nexus๋ฅผ ์ ๊ฐ์ต๋๋ค. ์ด๊ฒ์ด ๋ฌธ์ ์ ํต์ฌ ์ผ ์ ์์ง๋ง yarn
์ ์์กดํ๋ ๋ง์ ๋๊ตฌ๊ฐ ์ง์๋์ง ์๋ ๊ฒ ๊ฐ์์ ์ฌ์ฉํ ์ ์์ต๋๋ค. ์ ์ ํ ๊ตฌ๋ฌธ ๋ฑ์ ๋งค๊ฐ ๋ณ์๋ก _auth
์ ์ถ๊ฐํ๋ ค๊ณ ํ์ต๋๋ค. ์๋ฌด๊ฒ๋ ์๋ํ์ง ์๋ ๊ฒ ๊ฐ์ต๋๋ค. (FWIW : ์ฌ๋ฌ ๊ฐ์ ์ฌ๋์๊ฐ ๊ด๋ จ ๋ฌธ์ ์ ๋ํ ์์ ์ด๋ผ๊ณ ๊ฐ์ ํ์ต๋๋ค. ์ฑ๊ณต ์ฌ๋ถ์ ๊ด๊ณ์์ด ์ํํ์ต๋๋ค.)
Nexus์์ Yarn ์ธ์ฆ์ด ๊นจ ์ก์์ ํ์ธํ ์ ์์ต๋๋ค. yarn login
๋ ์ํธ๋ฅผ ๋ฌป๋ ๋ฉ์์ง๋ฅผ ํ์ํ์ง ์์ง๋ง ์ฑ๊ณต์ ์ผ๋ก ๋ก๊ทธ์ธ๋์๋ค๊ณ ๋งํฉ๋๋ค (๊ทธ๋ ์ง ์์์ต๋๋ค-rc ํ์ผ์ ๋ํ ๋ณ๊ฒฝ ์ฌํญ ์์).
๊ฒ์๋ ์ํธ๋ฅผ ์ ๋ ฅํ๋ผ๋ ๋ฉ์์ง๋ฅผ ํ์ํ๊ณ ๊ฒ์ํ์ง๋ง ๋งค๋ฒ ๋ก๊ทธ์ธํด์ผํ๋ ๊ฒฝ์ฐ __auth ํ ํฐ์์ ์ฝ์ง ์์ต๋๋ค. ๋ํ CI ์๋๋ฆฌ์ค์์ ์์ฌ๋ฅผ ์ฌ์ฉํ ์ ์์ต๋๋ค.
์ ์ฌ๋ CI ๋ด์์ ์๋ํ์ง ์์ต๋๋ค. ์ด๊ฒ์ด ์๋ํ ๊น์?
์ด ๋ฌธ์ ๋ https://github.com/yarnpkg/yarn/pull/5216 ์์ ํด๊ฒฐ๋์์ต๋๋ค
Fixes #4157, #4451, #4672, #4119.
์ด๋ก ์ธํด PR์ด ๋ณํฉ ๋ ๋ GitHub๊ฐ # 4157 ๋ง ์๋์ผ๋ก ๋ซํ์ต๋๋ค. ๋ค๋ฅธ ๋ฌธ์ ๋ ํด๊ฒฐ๋์์ ๊ฒ์ ๋๋ค.
@valscion ์ด๊ฒ์ https://github.com/yarnpkg/yarn/pull/5322 ์ ๊ฐ์ ๋ฌธ์ ์ ๋ ๋์์ด ๋ ์ ์์ง๋ง ๊ท ์ด์ ํตํด ๋ฏธ๋๋ฌ์ก์ต๋๋ค ..
๋ค๋ฅธ ๋ฐ์ดํฐ ํฌ์ธํธ ์ถ๊ฐ-yarn 1.8.x +๊ฐ ๋น๋ ์์ด์ ํธ (VSTS)์์ ์คํจํฉ๋๋ค. yarn
1.7.x๋ก ๋ ๋๋ฆฌ๋ฉด ๋ฌธ์ ๊ฐ ํด๊ฒฐ๋ฉ๋๋ค. ์ฌ๋ฐ๋ฅธ ๋ ์ง์คํธ๋ฆฌ๋ฅผ๋ณด๊ณ ์์ง๋ง ๋น๋ ์์ด์ ํธ๊ฐ .npmrc
์ ์ฝ์
ํ ํ ํฐ์ ์ฌ์ฉํ์ง ์์ต๋๋ค. ์ฌ๊ธฐ์ ๋ง์ ๋ณ์๊ฐ ์๋ค๋ ๊ฒ์ ์๊ณ ์์ง๋ง ์ ์ฉ ํ ๊ฒ์ด๋ผ๊ณ ์๊ฐํ์ต๋๋ค.
๋ด ์ฌ์ฉ์ .npmrc
ํ ํฐ์ด ์ ์ฅ๋๋ 1.9.x๋ฅผ ๋ก์ปฌ์์ ์คํํ๋ฉด ์ ์์ ์ผ๋ก ์๋ํฉ๋๋ค.
1.9.x ๋ฒ์
2018-08-03T21:17:04.9324575Z [command]C:\Windows\system32\cmd.exe /D /S /C "C:\Builds\_tool\yarn\1.9.4\x64\yarn-v1.9.4\bin\yarn.cmd build"
2018-08-03T21:17:05.4481355Z yarn run v1.9.4
2018-08-03T21:17:05.5418442Z $ lerna clean && lerna bootstrap
2018-08-03T21:17:08.3387809Z lerna info version 2.11.0
2018-08-03T21:17:08.3387809Z lerna info versioning independent
2018-08-03T21:17:08.3856545Z lerna info clean removing <REMOVED>
2018-08-03T21:17:08.3856545Z lerna info clean removing <REMOVED>
2018-08-03T21:17:08.3856545Z lerna info clean removing <REMOVED>
2018-08-03T21:17:08.3856545Z lerna info clean removing <REMOVED>
2018-08-03T21:17:08.4012821Z lerna info clean removing <REMOVED>
2018-08-03T21:17:08.4012821Z lerna info clean removing <REMOVED>
2018-08-03T21:17:08.4169058Z lerna info clean removing <REMOVED>
2018-08-03T21:17:08.4325326Z lerna info clean removing <REMOVED>
2018-08-03T21:17:08.4325326Z lerna info clean removing <REMOVED>
2018-08-03T21:17:08.7606628Z lerna success clean finished
2018-08-03T21:17:09.5145894Z lerna info version 2.11.0
2018-08-03T21:17:09.5145894Z lerna info versioning independent
2018-08-03T21:17:09.5419287Z lerna info Bootstrapping 9 packages
2018-08-03T21:17:09.5419287Z lerna info lifecycle preinstall
2018-08-03T21:17:09.5576221Z lerna info Installing external dependencies
2018-08-03T21:17:12.8857424Z lerna ERR! execute callback with error
2018-08-03T21:17:12.8857424Z lerna ERR! Error: Command failed: yarn install --mutex network:42424 --non-interactive
2018-08-03T21:17:12.8857424Z lerna ERR! warning package.json: No license field
2018-08-03T21:17:12.8857424Z lerna ERR! warning Waiting for the other yarn instance to finish (4048)
2018-08-03T21:17:12.8857424Z lerna ERR! warning Waiting for the other yarn instance to finish (6896)
2018-08-03T21:17:12.8857424Z lerna ERR! warning No license field
2018-08-03T21:17:12.8857424Z lerna ERR! error An unexpected error occurred: "<INTERNAL_REGISTRY>/lodash.foreach/-/lodash.foreach-2.3.0.tgz: Request failed \"401 Unauthorized\"".
2018-08-03T21:17:12.8857424Z lerna ERR! [1/4] Resolving packages...
2018-08-03T21:17:12.8857424Z lerna ERR! [2/4] Fetching packages...
2018-08-03T21:17:12.8857424Z lerna ERR! info If you think this is a bug, please open a bug report with the information provided in "C:\\Builds\\6\\s\\packages\\<REMOVED>\\yarn-error.log".
2018-08-03T21:17:12.8857424Z lerna ERR! info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
2018-08-03T21:17:12.8857424Z lerna ERR!
2018-08-03T21:17:12.8857424Z lerna ERR! at Promise.all.then.arr (C:\Builds\6\s\node_modules\lerna\node_modules\execa\index.js:236:11)
2018-08-03T21:17:12.8857424Z lerna ERR! at <anonymous>
2018-08-03T21:17:12.9482437Z lerna WARN complete Waiting for 1 child process to exit. CTRL-C to exit immediately.
2018-08-03T21:17:13.0732458Z { Error: Command failed: yarn install --mutex network:42424 --non-interactive
2018-08-03T21:17:13.0732458Z warning package.json: No license field
2018-08-03T21:17:13.0732458Z warning Waiting for the other yarn instance to finish (4048)
2018-08-03T21:17:13.0732458Z warning Waiting for the other yarn instance to finish (6896)
2018-08-03T21:17:13.0732458Z warning No license field
2018-08-03T21:17:13.0732458Z error An unexpected error occurred: "<INTERNAL_REGISTRY>/lodash.foreach/-/lodash.foreach-2.3.0.tgz: Request failed \"401 Unauthorized\"".
2018-08-03T21:17:13.0732458Z [1/4] Resolving packages...
2018-08-03T21:17:13.0732458Z [2/4] Fetching packages...
2018-08-03T21:17:13.0732458Z info If you think this is a bug, please open a bug report with the information provided in "C:\\Builds\\6\\s\\packages\\<REMOVED>\\yarn-error.log".
2018-08-03T21:17:13.0732458Z info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
2018-08-03T21:17:13.0732458Z
2018-08-03T21:17:13.0732458Z at Promise.all.then.arr (C:\Builds\6\s\node_modules\lerna\node_modules\execa\index.js:236:11)
2018-08-03T21:17:13.0732458Z at <anonymous>
2018-08-03T21:17:13.0732458Z at process._tickCallback (internal/process/next_tick.js:188:7)
2018-08-03T21:17:13.0732458Z code: 1,
2018-08-03T21:17:13.0732458Z killed: false,
2018-08-03T21:17:13.0732458Z stdout: '[1/4] Resolving packages...\n[2/4] Fetching packages...\ninfo If you think this is a bug, please open a bug report with the information provided in "C:\\\\Builds\\\\6\\\\s\\\\packages\\\\<REMOVED>\\\\yarn-error.log".\ninfo Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.\n',
2018-08-03T21:17:13.0732458Z stderr: 'warning package.json: No license field\nwarning Waiting for the other yarn instance to finish (4048)\nwarning Waiting for the other yarn instance to finish (6896)\nwarning No license field\nerror An unexpected error occurred: "<INTERNAL_REGISTRY>/lodash.foreach/-/lodash.foreach-2.3.0.tgz: Request failed \\"401 Unauthorized\\"".\n',
2018-08-03T21:17:13.0732458Z failed: true,
2018-08-03T21:17:13.0732458Z signal: null,
2018-08-03T21:17:13.0732458Z cmd: 'yarn install --mutex network:42424 --non-interactive',
2018-08-03T21:17:13.0732458Z timedOut: false,
2018-08-03T21:17:13.0732458Z exitCode: 1 }
2018-08-03T21:17:13.0888721Z error Command failed with exit code 1.
2018-08-03T21:17:13.0888721Z info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
1.7.X ๋ฒ์
2018-08-03T21:33:16.4477199Z [command]C:\Windows\system32\cmd.exe /D /S /C "C:\Builds\_tool\yarn\1.7.0\x64\yarn-v1.7.0\bin\yarn.cmd build"
2018-08-03T21:33:16.9633413Z yarn run v1.7.0
2018-08-03T21:33:17.0727225Z $ lerna clean && lerna bootstrap
2018-08-03T21:33:19.2509802Z lerna info version 2.11.0
2018-08-03T21:33:19.2509802Z lerna info versioning independent
2018-08-03T21:33:19.2666043Z lerna info clean removing <REMOVED>
2018-08-03T21:33:19.2666043Z lerna info clean removing <REMOVED>
2018-08-03T21:33:19.2666043Z lerna info clean removing <REMOVED>
2018-08-03T21:33:19.2666043Z lerna info clean removing <REMOVED>
2018-08-03T21:33:19.2978554Z lerna info clean removing <REMOVED>
2018-08-03T21:33:19.5478528Z lerna info clean removing <REMOVED>
2018-08-03T21:33:19.5478528Z lerna info clean removing <REMOVED>
2018-08-03T21:33:19.5478528Z lerna info clean removing <REMOVED>
2018-08-03T21:33:19.6728520Z lerna info clean removing <REMOVED>
2018-08-03T21:33:19.8759839Z lerna success clean finished
2018-08-03T21:33:20.5947225Z lerna info version 2.11.0
2018-08-03T21:33:20.5947225Z lerna info versioning independent
2018-08-03T21:33:20.6103497Z lerna info Bootstrapping 9 packages
2018-08-03T21:33:20.6103497Z lerna info lifecycle preinstall
2018-08-03T21:33:20.6415982Z lerna info Installing external dependencies
2018-08-03T21:33:23.1103303Z lerna info Symlinking packages and binaries
2018-08-03T21:33:23.1415791Z lerna info lifecycle postinstall
2018-08-03T21:33:23.1415791Z lerna info lifecycle prepublish
2018-08-03T21:33:23.1415791Z lerna info lifecycle prepare
2018-08-03T21:33:23.1415791Z lerna success Bootstrapped 9 packages
2018-08-03T21:33:23.1572133Z $ ts-node ./build/index.ts
2018-08-03T21:33:58.5218101Z Done in 41.54s.
์๋ ํ์ธ์ ์ฌ๋ฌ๋ถ,์ด ๋ฌธ์ ๋ฅผ ํ๋ก์ฐํ๊ณ ๊ฐ์ธ ๋ ์ง์คํธ๋ฆฌ๋ฅผ ์ฌ์ฉํ๋ ์ฌ๋๋ค์๊ฒ ์์ฒญ์ด ์์ต๋๋ค.
์ ๊ธ ํ์ผ์์ ๋ ์ง์คํธ๋ฆฌ ํธ์คํธ ์ด๋ฆ ์ ํ๊ณ ์์ต๋๋ค . ์ด๋ ๊ฒํ๋ฉด ๊ฐ์ธ ๋ ์ง์คํธ๋ฆฌ์์ ๋ค๋ฅธ ๋ ์ง์คํธ๋ฆฌ๋ก ์ฝ๊ฒ ์ ํ ํ ์ ์์ง๋ง ๋จ์ ์ ๋ชจ๋ ๋ ์ง์คํธ๋ฆฌ๊ฐ ์ ์ฌํ URL์ ์ฌ์ฉํด์ผํ๋ค๋ ๊ฒ์ ๋๋ค (ํธ์คํธ ์ด๋ฆ์ด URL์ ์ผ๋ถ๊ฐ ์๋๊ธฐ ๋๋ฌธ์ ๋ฐํ์์ ํ์ฑ ๊ตฌ์ฑ).
# 5892์์์ด ์ํฌ ํ๋ก๊ฐ ๊ฐ์ธ ๋ ์ง์คํธ๋ฆฌ ์ ๊ณต ์ ์ฒด์์ ์๋ํ๋์ง ํ์ธํ๋ ๋ฐ ๋์์ ์ฃผ์๊ฒ ์ต๋๊น (๋๋ ๊ทธ๋ ์ง ์์ ๊ฒฝ์ฐ ์๋ ค์ฃผ์ธ์)? ์ด๋ ๊ฒํ๋ฉด ์ด๋ฌํ ๋ณํ๋ฅผ ๋ง๋๋ ๋ฐ ํ์ํ ์์ค์ ์์ ๊ฐ์ ์ป์ ์ ์์ต๋๋ค. ๊ฐ์ฌ!
yarn publish
๋ด .npmrc
์์ ์ธ์ฆ ํ ํฐ์ ์ฝ์ง ๋ชปํ๋ ๋ฌธ์ ๊ฐ ๋ฐ์ํฉ๋๋ค. ๋๋ ์ด๊ฒ์ ์ฐ๋ถํฌ์์ ์คํํ๊ณ ์์ต๋๋ค.
์์ฌ-1.9.4
npm-5.5.1
๋ค์์ ๋ด ~/.npmrc
๋ชจ์ต์
๋๋ค (ํ ํฐ ๋ฐ ๋ ์ง์คํธ๋ฆฌ๊ฐ ๋๋
ํ๋จ).
registry=http://myprivateregistry.net/
//myprivateregistry.net/:_authToken="myAuthToken"
yarn publish --noninteractive
์คํํ๋ฉด ๋ค์ ์ค๋ฅ๊ฐ ํ์๋ฉ๋๋ค.
yarn publish v1.9.4
[1/4] Bumping version...
info Current version: 2.1.3
[2/4] Logging in...
error No token found and can't prompt for login when running with --non-interactive.
info Visit https://yarnpkg.com/en/docs/cli/publish for documentation about this command.
๋๋ ์์ฉ์ด์๋ ๋ค์์ ์๋ํ์ต๋๋ค.
~/.npmrc
๋ฅผ ๋ด ํ๋ก์ ํธ ๋๋ ํ ๋ฆฌ์ ๋ก์ปฌ .npmrc
์ ๋ณต์ฌyarn publish
์คํํ๊ธฐ ์ ์ ๋ด ์๊ฒฉ ์ฆ๋ช
์ผ๋ก yarn login
์คํ๋ํ npm publish
๋ฅผ ์คํํ๋ฉด ์ธ์ฆ ๋จ๊ณ๋ฅผ ํต๊ณผํ๋ ๊ฒ์ผ๋ก ํ์ธ๋์์ต๋๋ค (๋์ผํ ๋ฒ์ ๋ฒํธ๋ฅผ ์ฌ์ ์ ํ ์ ์๊ธฐ ๋๋ฌธ์ ๋ฒ์ ๊ด๋ฆฌ ๋จ๊ณ์์ ์คํจํฉ๋๋ค. ์ด๊ฒ์ด ์ ๊ฐ yarn publish --non-interactive
์ ์ฌ์ฉํ๋ ์ด์ ์
๋๋ค.)
๋ด๊ฐ ๋์น ๋ค๋ฅธ ๊ฒ์ด ์์ต๋๊น? ๊ฐ์ฌ!
@ liuhelen10 ํ๋ก์ ํธ์ .yarnrc
ํ์ผ์ด ์์ต๋๊น? ์ด๊ฒ์ ~/.npmrc
์์ ์ ์ฅ๋ ํ ํฐ์ผ๋ก ๋๋ฅผ ์ํด ์ผํ์ต๋๋ค.
์
$ cat .yarnrc
registry "https://registry.npmjs.org/"
.npmrc์ always-auth = true
์ด ํธ๋ฆญ์ ์ํํ์ฌ Yarn์ ์ฌ์ฉํ๋ ๋์ ๋ ์ด์ 401์๋ฐ์ง ๋ชปํ์ต๋๋ค.
๋ง์ด ์๋์ง๋ง ๋ญ๋ ์ง :)
์ด๋ 2017 ๋ ์๋ณด๊ณ ๋์์ผ๋ฉฐ ํ์ฌ 2019 ๋ ์ด๋ฉฐ์ด ๋ฌธ์ ๋ ์ฌ์ ํ ์กด์ฌํฉ๋๋ค.
๋์ํฉ๋๋ค. ์ฌ์ ํ ์๋ํ์ง ์์ต๋๋ค.
.npmrc
always-auth=true
<strong i="7">@somename</strong>:registry=https://npm.pkg.github.com/
//npm.pkg.github.com/:_authToken=[token]
.yarnc
"<strong i="11">@somename</strong>:registry" "https://npm.pkg.github.com/"
npm.pkg.github.com์์๋ ์ค๋ฅ๊ฐ ๋ฐ์ํฉ๋๋ค.
Integrity checked failed (none of the specified algorithms are supported
npm.pkg.github.com์์๋ ์ค๋ฅ๊ฐ ๋ฐ์ํฉ๋๋ค.
Integrity checked failed (none of the specified algorithms are supported
์ด๊ฒ๋ ์ป๊ณ
Nexus ๋ฒ์ 3์ ์ฌ์ฉํ์ฌ ๋์ผํ ๋ฌธ์ ๊ฐ ๋ฐ์ํ์ง๋ง์ด ๋ฌธ์ https://github.com/yarnpkg/yarn/issues/3093#issuecomment -317671597์์ @plitex ๊ฐ ์ธ๊ธ ํ ์ ๊ทผ ๋ฐฉ์์ ์ฌ์ฉํ์ฌ ํด๊ฒฐ๋์์ต๋๋ค.
์ด ์ฝํ
์ธ ๋ฅผ .npmrc
ํ์ผ์ ๋ฃ์ต๋๋ค. .yarnrc
ํ์ผ์๋ ์ค์ ์ด ํ์ํ์ง ์์ต๋๋ค.
always-auth=true
registry=https://nexus.server.com/repository/npm-group/
//nexus.server.com/repository/npm-group/:_authToken={AUTH_TOKEN}
์์ฌ-๋ฒ์
1.17.3
npm-๋ฒ์
6.10.2
@nbransby , @revmischa : ๋ฌธ์ # 7552๋ ํ์ธํ์ธ์.์ด ๊ฒฝ์ฐ ์ค๋ฅ ๋ฉ์์ง๊ฐ ์ ํํ ์ ์์ต๋๋ค.
์ ์๊ฒ ๋์์ด ๋ ๋ ๊ฐ์ง :
์์ฌ 1.19.1์์์ด ์ค๋ฅ๊ฐ ๋ฐ์ํ๊ธฐ ์์ํ์ต๋๋ค. ํด๋น ์์ฌ๊ฐ .npmrc
์์ ๋ ์ง์คํธ๋ฆฌ ๋ฐ ํ ํฐ ์ ๋ณด๋ฅผ ์ฌ๋ฐ๋ฅด๊ฒ ์ ํํ๋ ๊ฒ์ฒ๋ผ ๋ณด์์ง๋ง 1.19.1์์๋ .yarnrc
์๋ registry
๊ตฌ์ฑ์ ์ถ๊ฐํด์ผํ์ต๋๋ค. ๊ทธ๋ ์ง ์์ผ๋ฉด ๋ฐฉ๊ธ 401 ์ค๋ฅ๊ฐ ๋ฐ์ํ์ต๋๋ค.
์๋ฃ๋๋ฉด ์๋ํ๊ณ ๊ณ์ํด์ .npmrc
์์ ํ ํฐ์ ๊ฐ์ ธ ์์ต๋๋ค. ๋์๊ฒ ํ๊ท์ฒ๋ผ ๋ณด์
๋๋ค. ๋ ์ง์คํธ๋ฆฌ ๊ตฌ์ฑ์ .npmrc
์์ .yarnrc
๋ก ๋ณต์ ํ ์ข์ ์ด์ ๊ฐ์๋ ๊ฒ ๊ฐ์ต๋๋ค.
@rocketraman ์ฒ๋ผ yarn 1.19.1์ ์ค์นํ์๋ง์ ๊ฐ์ธ ๋ ์ง์คํธ๋ฆฌ (nexus)์์ ๋ฒ์ ์ง์ ํจํค์ง๋ฅผ ์ค์นํ๋ ค๊ณ ํ ๋ 401s๊ฐ ๋ฐ์ํ๊ธฐ ์์ํ์ต๋๋ค. npm install
์ ์๋ํฉ๋๋ค.
๋ค์ด ๊ทธ๋ ์ด๋ ๋ ์ค๊ณผ ๋ชจ๋ ๋ค์ ์๋ :
curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version 1.17.3
์ด๊ฒ์ด ์ฌ์ ํ ๋ฌธ์ ์์ ํ์ธํ ์ ์์ต๋๋ค.
yarn install
์คํ์ 401 ์ค๋ฅ ๋ฐ์
Request "https://npm.pkg.github.com/user/@scope/package" finished with status code 401.
npn install
๋ ๋ฌธ์ ์์ด ์คํ๋ฉ๋๋ค.
์ง๋ 2 ์๊ฐ ๋์์ด ๋ฌธ์ ๋ฅผ ๋๋ฒ๊น ํ์ผ๋ฉฐ ์ ์น๊ตฌ @AndreiCalazans ๋๋ถ์ ํด๊ฒฐ ๋ฐฉ๋ฒ์ด ์์ต๋๋ค.
์ ์ฌํ ๋ฌธ์ ๋ก ์ด๋ ค์์ ๊ฒช๊ณ ์๋ ๋ชจ๋ ์ฌ๋์ ์ํด ์ฌ๊ธฐ์์ ๊ณต์ ํฉ๋๋ค.
yarn
์์
์์ญ์ ์ฌ์ฉํ๋ ํ๋ก์ ํธ๋ฅผ Heroku์ ๋ฐฐํฌํ๊ณ ์์ต๋๋ค. yarn.lock
ํ๊ณ npm install
๋ฅผ ์ฌ์ฉํ๋๋ผ๋ ํ๋ก์ ํธ๋ ์์
๊ณต๊ฐ์ผ๋ก ๋น๋๋๊ณ yarn
์์ด๋ _ ์ ํ ์๋ํ์ง ์์ต๋๋ค _.
ํ๋ก์ ํธ๋ GitHub ํจํค์ง์์ ํธ์คํ ๋๋ ํจํค์ง์ ์์กดํ๋ฉฐ ํ ํฐ์ ํตํด GitHub์ ๋ํด ์ธ์ฆํด์ผํฉ๋๋ค.
Heroku๊ฐ๋ ๋ณผ ๊ฒ์ด๋ค yarn.lock
ํ๊ณ ์ ์ข
์์ฑ์ ์ค์น yarn
๋ฌด์ํฉ๋๋ค, ~/.npmrc
I ์ฌ์ ๋น๋๋ฅผ ๋ง๋๋ ๊ฒ์ด ํ์ผ์.
์ฌ์ ๋น๋, ๋๋ ์คํํ ๊ฒ์ ๋๋ค
echo "always-auth=true\n//npm.pkg.github.com/:_authToken=${GITHUB_NPM_TOKEN}\" >> ~/.npmrc",
๊ทธ๋ฌ๋ฉด ๋ค์ ๋ด์ฉ์ด ํฌํจ ๋ ~/.npmrc
ํ์ผ์ด ์์ฑ๋ฉ๋๋ค.
always-auth=true
//npm.pkg.github.com/:_authToken=whatevermytokenis
yarn
๋ ์ด๊ฒ์ ๋ฌด์ํ๊ณ 401 Unauthorized
GitHub ํจํค์ง ๋ ์ง์คํธ๋ฆฌ์์ ์ข
์์ฑ์ ๊ฐ์ ธ ์ค๋ ค๊ณ ํ ๋ ์คํจํฉ๋๋ค.
Andrei๋ GitHub ๋ ์ง์คํธ๋ฆฌ๋ฅผ ์ฌ์ฉํ๊ธฐ ์ํด _ ์กฐ์ง ๋ง _ ์จ๋ฆฌ์ด์ฑํ๊ณ , _GitHub ๋ ์ง์คํธ๋ฆฌ ํ ํฐ์ ์๋์ ์ถ๊ฐํ์ต๋๋ค.
๊ธฐ๋ณธ์ ์ผ๋ก ~/.npmrc
ํ์ผ์ ์ฝ๊ฐ ๋ณ๊ฒฝํ์ฌ ๋ค์์ ์ถ๊ฐํฉ๋๋ค.
always-auth=true
+<strong i="36">@MY_ORG</strong>:registry=https://npm.pkg.github.com/
//npm.pkg.github.com/:_authToken=whatevermytokenis
๋ชจ๋ ๊ฒ์ด ํด๊ฒฐ๋์๊ณ ๊ฐ์๊ธฐ yarn
๊ฐ GitHub ์กฐ์ง์ธ @MY_ORG
๋ชจ๋ ํจํค์ง์ ๋ํด npm.pkg.github.com
์ ์ ๊ณต๋ ์ธ์ฆ ํ ํฐ์ ์ฌ์ฉํ์ต๋๋ค.
์ํด! ๋๊ตฐ๊ฐ์๊ฒ ๋์์ด ๋์๊ธฐ๋ฅผ ๋ฐ๋๋๋ค! ๐
์ด๊ฒ์ ์ฌ์ ํ โโ๋ฌธ์ ์
๋๋ค !! NPM ์ค์น๋ ๋ฌธ์ ์์ด ์คํ๋ฉ๋๋ค.
error Couldn't find package "@diligentcorp/atlas-react" on the "npm" registry.
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.
๋ด Windows ์ปดํจํฐ์์ ๋ฌธ์ ๋ ๋ด ์ฌ์ฉ์ ์์ค .npmrc ํ์ผ์ด์๋ ์ฌ์ฉ์ ํด๋๊ฐ ๋คํธ์ํฌ ๋๋ผ์ด๋ธ์ ์๋ค๋ ๊ฒ์ ๋๋ค. ์ปดํจํฐ์ ๋ก์ปฌ ์ฌ์ฉ์ ํด๋์ .npmrc ํ์ผ์ด ์์ง๋ง yarn์ด์ด ํด๋๋ฅผ ์ฐพ๋ ๊ฒ ๊ฐ์ต๋๋ค. ๋คํธ์ํฌ ๋๋ผ์ด๋ธ์์ ๋ก์ปฌ ์ฌ์ฉ์ ํด๋๋ก .npmrc๋ฅผ ๋ณต์ฌํ๋ฉด ๋ฌธ์ ๊ฐ ํด๊ฒฐ๋์์ต๋๋ค (์ธ์ฆ ํ ํฐ์ด ์ฌ์ฉ์ ์์ค .npmrc์ ์ ์ฅ ๋จ).
๋๋ ์ฐ์ฐํ "cd ~"๋ฅผ ๋ด git bash์ ์ ๋ ฅ ํ ํ ์๊ฒฉ ํ ํด๋ (๋ด๊ฐ ์ฌ์ฉํ์ง ์๋)๋ก ์ ํ๋์์์ ๋ฐ๊ฒฌํ๋ค.
@TejasQ ํด๊ฒฐ ๋ฐฉ๋ฒ์ด ์ ์๊ฒ ํจ๊ณผ์ ์ด์ง ์์์ต๋๋ค.
๋ํ GitHub ํจํค์ง๋ฅผ ์ฌ์ฉํ๊ณ ์์ต๋๋ค.
npm
์ (์) ์๋ฒฝํ๊ฒ ์๋ํ์ง๋ง ์ฌ์ ํ 401 unauthorized
๋ฐ๊ณ ์์ต๋๋ค.
๋๋ ์ค v1.22.0์ผ๋ก ์๋ํ๋๋ก ๊ด๋ฆฌํ์ต๋๋ค.
.npmrc
always-auth=true
<strong i="7">@fortawesome</strong>:registry=https://npm.fontawesome.com
//npm.fontawesome.com/:_authToken=xyz-xyz-xyz-xyz
.yarnrc
"<strong i="11">@fortawesome</strong>:registry" "https://npm.fontawesome.com"
registry "https://some-regular-registry.org"
๊ทธ๋ฐ ๋ค์ yarn add @fortawesome/fontawesome-pro
๋ฅผ ์คํํฉ๋๋ค.
๋์๊ฒ๋ .npmrc
์ผ๋ก ๋ง ์๋ ํ ์ ์๊ธฐ๋ฅผ ๋ฐ๋์ง๋ง .yarnrc
์ถ๊ฐ ํ ๋๋ง ์๋ํ๋ฏ๋ก yarn์ ๋ํด์๋ง ๊ตฌ์ฑ์ ๋ณต์ ํด์ผํฉ๋๋ค.
๋๋ ์ด๊ฒ์ด ๋ด๊ฐ ๊ฒช๊ณ ์๋ ๊ฒ์ด๋ผ๊ณ ์๊ฐํ๋ค. .npmrc
๊ฐ ํ ๋๋ ํ ๋ฆฌ์ ์์ง๋ง ํ๋ก์ ํธ ๋๋ ํ ๋ฆฌ์๋ ์์ ๋ ์๋ํฉ๋๋ค (jenkins / travis์ ํ์).
https://github.com/yarnpkg/yarn/issues/8034
์ด๊ฒ์ ๋๋ฅผ ์ํด ํด๊ฒฐ๋์์ต๋๋ค : https://github.com/yarnpkg/yarn/issues/4451#issuecomment -570691809
๋ฒ์๊ฐ ์ง์ ๋ ๋ ์ง์คํธ๋ฆฌ๋ฅผ ์ค์ ํ ๋ ๋ ์ง์คํธ๋ฆฌ ๋ค์ /name
๊ฐ ์๋์ง ํ์ธํ์ญ์์ค.
- <strong i="7">@4r7d3c0</strong>:registry=https://npm.pkg.github.com/4r7d3c0
+ <strong i="8">@4r7d3c0</strong>:registry=https://npm.pkg.github.com
๋ฌธ์์ ๋ฐ๋ผ registry=https://npm.pkg.github.com/OWNER
, ๋ฒ์๋ฅผ ์ค์ ํ ๋ ์์ ์๊ฐ ๊ฑฐ๊ธฐ์์์ ํ์๊ฐ ์๋ค๋ ๊ฒ์ ๊ฐ๊ณผํ์ต๋๋ค. NPM์ ์ฒ๋ฆฌ ํ ์ โโ์์ง๋ง ์ ์ฌ๋ ์ฒ๋ฆฌ ํ ์ โโ์์ต๋๋ค.
๋ณ์นญ์ ์ฌ์ฉํ๋ ๊ฒฝ์ฐ ๋ค์ ํด๊ฒฐ ๋ฐฉ๋ฒ์ ํ์ธํ์ญ์์ค. https://github.com/yarnpkg/yarn/issues/8130#issuecomment -636281053
Yarn์ด GitHub ํจํค์ง ํ ํฐ์ ์กด์คํ๋๋ก ์ฌ์ฉ์ ์์ค .npmrc
๋ฐ ํ๋ก์ ํธ ์์ค .npmrc
๋ฅผ ๋ถํ ํด์ผํ์ต๋๋ค. ์ฌ์ฉ์ ์์ค์์ ํ๋ก์ ํธ ์์ค์ผ๋ก ๋ช
๋ช
๋ ๋ ์ง์คํธ๋ฆฌ ์ ์ธ์ ์ด๋ํ๋ ๊ฒ์ด ํต์ฌ์ด์์ต๋๋ค.
~/.npmrc
_auth=#####TOKEN_FOR_ARTIFACTORY#####
always-auth=true
registry=https://artifactory.mycompany.net/artifactory/api/npm/npm/
//npm.pkg.github.com/:_authToken=####GitHub_NPM_REGISTRY_TOKEN#####
~/projects/blah/.npmrc
<strong i="14">@mycompany</strong>:registry=https://npm.pkg.github.com
^ ๋ช
๋ช
๋ ํจ๋ฐ๋ฆฌ ํจํค์ง ๋ ์ง์คํธ๋ฆฌ ํญ๋ชฉ์ ํ๋ก์ ํธ ์์ค .npmrc
๋ก ์ฎ๊ธธ ๋๊น์ง yarn install
๋ 401์ ์ ๊ณตํ์ต๋๋ค ( @mycompany
์๋์ GH ํธ์คํ
ํจํค์ง์ ๊ฒฝ์ฐ).
Docker ๋น๋์ ๊ฒฝ์ฐ ๋ณ๋๋ก ๋ง์ดํธํ์ญ์์ค.
base.Dockerfile
:
# syntax=docker/dockerfile:1-experimental
## ^ need to enable --mount=type=secret support
ARG BASE_IMAGE
FROM ${BASE_IMAGE} as build
# note that only project-level .npmrc is copied
COPY package.json yarn.lock .npmrc ./
# ~/.npmrc with actual secrets is mounted as "secret" (does not stay in image)
RUN --mount=type=secret,id=npmrc,target=/root/.npmrc,required \
yarn install --production --frozen-lockfile ...
Docker ๋น๋ ๋ช ๋ น :
DOCKER_BUILDKIT=1 docker build \
--build-arg BASE_IMAGE=$(BASE_IMAGE) \
--secret id=npmrc,src="$(HOME)/.npmrc" \
-t $(IMAGE_NAME):$(IMAGE_TAG) \
-f base.Dockerfile .
_ (์ฐธ๊ณ ,์ด ์์
์ ์ํด .yarnrc
๊ฐ ํ์ํ์ง ์์์ง๋ง, ์ ๋ yarn 1.17.3์ ์ฌ์ฉํ๊ณ ์์ผ๋ฏ๋ก ๋ค๋ฅธ ๋ฒ์ ์์๋ ๋ค๋ฅผ ์ ์์ต๋๋ค.) _
๋๋ ์กฐ๊ธ arround๋ฅผ ํํค ์ณค๊ณ yarn์ด ์๋ชป๋ ์ธ์ฆ ์๊ฒฉ ์ฆ๋ช ์ ์ฌ์ฉํ๋ ๊ฒ ๊ฐ์ต๋๋ค.
~ / .npmrc
//npm-old.visualon.de/npm/vo-npm/:_password=XXXXXX
//npm-old.visualon.de/npm/vo-npm/:username=kriese
//npm-old.visualon.de/npm/vo-npm/:always-auth=true
//npm-new.visualon.de/:_authToken="XXXXXX"
package.json
{
"name": "yarn-auth",
"version": "1.0.0",
"main": "index.js",
"license": "MIT",
"dependencies": {
"tslib": "^2.0.1",
"moment": "2.20.1"
}
}
yarn.lock
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1
[email protected]:
version "2.20.1"
resolved "https://npm-old.visualon.de/npm/vo-npm/moment/-/moment-2.20.1.tgz#d6eb1a46cbcc14a2b2f9434112c1ff8907f313fd"
integrity sha1-1usaRsvMFKKy+UNBEsH/iQfzE/0=
tslib@^2.0.1:
version "2.0.1"
resolved "https://npm-new.visualon.de/tslib/-/tslib-2.0.1.tgz#410eb0d113e5b6356490eec749603725b021b43e"
integrity sha512-SgIkNheinmEBgx1IUNirK0TUD4X9yjjBRTqqjggWCU3pUEqIk3/Uwl3yRixYKT6WjQuGiwDv4NomL3wqRCj+CQ==
yarn์ ์ค์นํ๋ ๋์ bearer
ํ ํฐ์ npm-new.visualon.de
์์ npm-old.visualon.de
๋ณด๋
๋๋ค. ๊ทธ๋์ semms yarn์ ๊ธฐ๋ณธ ๋๋ฉ์ธ๋ง์ ๋น๊ตํฉ๋๋ค.
๋๊ตฐ๊ฐ๊ฐ ์ฌ์ ํ ๊ทธ๊ฒ์ ์ง๋ฉดํ๋ค๋ฉด ์ด๊ฒ์ด ๋๋ฅผ ์ํด ์ผํ ๊ฒ์ ๋๋ค.
.npmrc:
always-auth=true
<strong i="6">@orgaccount</strong>:registry=https://npm.pkg.github.com
registry=https://registry.yarnpkg.com
https://npm.pkg.github.com/:_authToken=yyyyjjjjj3333888etc
๋๊ตฐ๊ฐ ๋น์ทํ ๋ฌธ์ ์ ์ง๋ฉดํ๋์ง ํ์คํ์ง ์์ง๋ง ๋๊ตฐ๊ฐ ์๊ฐ์ ์ ์ฝํ๋ ๋ฐ ๋์์ด ๋ ์ ์์ต๋๋ค.
Azure Artifacts๋ฅผ ๊ฐ์ธ ๋ ์ง์คํธ๋ฆฌ๋ก ์ฌ์ฉํ๊ณ ์์ผ๋ฉฐ ๊ฑฐ๊ธฐ์ ์ค๋ช
๋๋๋ก PAT ๋ฐ .npmrc ํ์ผ์ ์ค์ ํ์ต๋๋ค.
๊ทธ๋ผ์๋ ๋ถ๊ตฌํ๊ณ npm install
๊ฐ ์๋ฒฝํ๊ฒ ์๋ํ๋ ๊ฒ๊ณผ ๋์ผํ ๋ฌธ์ ๊ฐ ๋ฐ์ํ์ง๋ง yarn install
๋ ํญ์ 401 ์ค๋ฅ๊ฐ ๋ฐ์ํฉ๋๋ค.
์ฝ๊ฐ์ ์๋์ ์ค๋ฅ ํ ๋ ์ง์คํธ๋ฆฌ URL (... @ Local / ...)์ ํน์ ๋ฌธ์๊ฐ์๋ ๊ฒ์ผ๋ก ๋ฐํ์ก์ง๋ง Azure Artifacts๋์ด๋ฅผ ์ค์ ๊ฐ์ด๋ ๋ด์ ์ ๋ ์ฝ๋ ํํ์ผ๋ก ํด๊ฒฐํฉ๋๋ค. npm์ ์ด๊ฒ์ ์ ์ฒ๋ฆฌํฉ๋๋ค. URL์ ์ค์ @ ๋ฌธ์๋ฅผ ์ค์ ํ๋ฉด ๋ฌธ์ ๊ฐ ํด๊ฒฐ๋์์ต๋๋ค.
๊ฐ์ฅ ์ ์ฉํ ๋๊ธ
์ด๋ 2017 ๋ ์๋ณด๊ณ ๋์์ผ๋ฉฐ ํ์ฌ 2019 ๋ ์ด๋ฉฐ์ด ๋ฌธ์ ๋ ์ฌ์ ํ ์กด์ฌํฉ๋๋ค.