npm
λͺ
λ Ήμ npm install -g npm
μ€ν ν μ κ±°λ©λλ€.
μ΄κ²μ λ‘κ·Έμ
λλ€.
~
% brew install node
==> Downloading https://homebrew.bintray.com/bottles/node-13.3.0_1.catalina.bottle.tar.gz
Already downloaded: /Users/manabu/Library/Caches/Homebrew/downloads/8a482358c0487b3ffeeebf4d1f3b3ca825018f6318ecdd6368fd0a6f45e0bea1--node-13.3.0_1.catalina.bottle.tar.gz
==> Pouring node-13.3.0_1.catalina.bottle.tar.gz
==> Caveats
Bash completion has been installed to:
/usr/local/etc/bash_completion.d
==> Summary
πΊ /usr/local/Cellar/node/13.3.0_1: 4,663 files, 59MB
~
% npm install -g npm
/usr/local/bin/npx -> /usr/local/lib/node_modules/npm/bin/npx-cli.js
/usr/local/bin/npm -> /usr/local/lib/node_modules/npm/bin/npm-cli.js
npm ERR! code EEXIST
npm ERR! syscall symlink
npm ERR! path ../../../lib/node_modules/npm/man/man1/npm-access.1
npm ERR! dest /usr/local/share/man/man1/npm-access.1
npm ERR! errno -17
npm ERR! EEXIST: file already exists, symlink '../../../lib/node_modules/npm/man/man1/npm-access.1' -> '/usr/local/share/man/man1/npm-access.1'
npm ERR! File exists: /usr/local/share/man/man1/npm-access.1
npm ERR! Remove the existing file and try again, or run npm
npm ERR! with --force to overwrite files recklessly.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/manabu/.npm/_logs/2019-12-18T07_51_00_280Z-debug.log
brew reinstall node
μ€ννμ λμ΄ λ¬Έμ κ° λ€μ λ°μνμμ νμΈνμ΅λλ€.
μ€μ λ‘ μΆλ ₯μμ ββλ§νλ―μ΄ --force
μ±κ³΅μ μΌλ‘ μ€ννμ§λ§ μ΄λ¬ν λ‘κ·Έλ₯Ό νμνλ κ²μ΄ npm
λͺ
λ Ήμ μ κ±°νλ κ²λ³΄λ€ λ«λ€κ³ μκ°ν©λλ€.
μμ (2020/01/11) :
μ€μ λ‘ μΆλ ₯μμ ββλ§νλ―μ΄
--force
μ±κ³΅μ μΌλ‘ μ€ννμ΅λλ€.
λ ꡬ체μ μΌλ‘ λ€μ λ¨κ³λ₯Ό μννμ΅λλ€.
npm install -g npm
μν΄ μ κ±° λ npm
λͺ
λ Ή 볡μbrew reinstall node
λ₯Ό μ€ννμ¬ λ³΅μνμ΅λλ€.npm install -g --force npm
μ€νμ @isaacs 'λ³νμ κ΄λ ¨λ https://github.com/npm/cli/commit/320ac9aeeafd11bb693c53b31148b8d10c4165e8 NPM / λΉ - λ§ν¬ # 12 NPM / λΆλλ¬μ΄-FS # 7 λ μ λ°ν [email protected]
homebrew https://github.com/Homebrew/homebrew-core/commit/6acc21a27d0ba4ecfd6ebf4d77af7025143daefe#diff -d3ef2414308e30df24a517ca9a1324ee @pepyakin @fxcoudertμ μν΄ μμ± / μ»€λ° λ¨ )
AFAICS μ΄κ²μ npmμμ μλ λ λμμ λλ€. μ΄κ²μ΄ νλΈλ₯ μ€μ μμ μ΄λ»κ² μ²λ¦¬λμ΄μΌνλμ§ λΆλΆλͺ ν©λλ€.
https://github.com/npm/cli/issues/672
yarn global add npm
μ (λ₯Ό) μ€μΉνκ³ [email protected]
μ€μΉνλλ° μ€λ₯κ° λ°μνμ§ μμμ§λ§ μ΄μ μ΄μ μ λͺ¨λ κΈλ‘λ² ν¨ν€μ§κ° μ¬λΌμ‘μ΅λλ€ : ((
λλ homebrewμμ μ΅νΈ μμνκ³ λ¨μν https://github.com/nvm-sh/nvmμ μ¬μ©νμ΅λλ€.
κ·Έλ₯ ν΄
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.2/install.sh | bash
κ·Έλ¬λ©΄ μ΄λκ°μ
=> Compressing and cleaning up git repository
=> Appending nvm source string to /Users/aprilmintacpineda/.bash_profile
=> Appending bash_completion source string to /Users/aprilmintacpineda/.bash_profile
=> Close and reopen your terminal to start using nvm or run the following to use it now:
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
source <name of profile>
λ΄ κ²½μ° <name of profile>
λ ~/.bash_profile
μ΄λ―λ‘ source ~/.bash_profile
κ·Έλ
nvm install node
λ
Έλμ μ΅μ λ²μ μ μ€μΉνλ©΄ μ΅μ λ²μ μ npmλ μ€μΉλλ©° μ μκ² ν¨κ³Όμ μ΄μμ΅λλ€.
μ΄ μ€λ λμ λͺ¨λ μ¬λμκ² λΉμ μ΄ λ¬΄μμνκ³ μκ³ κ·Έ μ΄μ λ₯Ό μκ³ μλ€λ©΄ ν΄κ²°μ± μ΄ λ¨μν
npm i -g --force npm
( --force
νλκ·Έ μ°Έκ³ )
λ¬Έμ λ npm -I npmμ μννκ³ μ€λ₯κ° λ°μν ν 'zsh : command not found : npm'μΌλ‘ npm λͺ λ Ήμ μλνλ©΄ μ€ν¨νλ―λ‘ μνλ κ²½μ°μλ --force λͺ λ Ήμ μν ν μ μμ΅λλ€. npmμ λ€μ μ»κΈ° μν΄ λ Έλλ₯Ό λ€μ μ€μΉν΄μΌνμ΅λλ€.
μ£μ‘ν©λλ€.μ΄ λ¬Έμ λ₯Ό μΌμμ μΌλ‘ νΌνλ λ°©λ²μ μμ ν μ€λͺ νμ§ μμμ΅λλ€. μ€λͺ μ μ λ°μ΄νΈνμ΅λλ€. ν λ² λ΄μ£ΌμΈμ.
μ΄ μ€λ λμ λͺ¨λ μ¬λμκ² λΉμ μ΄ λ¬΄μμνκ³ μκ³ κ·Έ μ΄μ λ₯Ό μκ³ μλ€λ©΄ ν΄κ²°μ± μ΄ λ¨μν
npm i -g --force npm
(--force
νλκ·Έ μ°Έκ³ )
μ΄κ²μ μ€μ λ‘ μ΄κ²μ κ³ μΉλ μ μΌν ν΄κ²°μ± μ΄μμ΅λλ€.
λ λ²μ§Έλ‘ μ΄κ²μ λͺ μ£Ό μμ λμκ² λ°μν©λλ€. brew reinstall node
μμ ν μ μμ΅λλ€.
λ€μμ npm install -g npm
μ€νμ€μΈ μΆλ ₯μ
λλ€.
/usr/local/bin/npm -> /usr/local/lib/node_modules/npm/bin/npm-cli.js
/usr/local/bin/npx -> /usr/local/lib/node_modules/npm/bin/npx-cli.js
npm ERR! code EEXIST
npm ERR! syscall symlink
npm ERR! path ../../../lib/node_modules/npm/man/man1/npm-adduser.1
npm ERR! dest /usr/local/share/man/man1/npm-adduser.1
npm ERR! errno -17
npm ERR! EEXIST: file already exists, symlink '../../../lib/node_modules/npm/man/man1/npm-adduser.1' -> '/usr/local/share/man/man1/npm-adduser.1'
npm ERR! File exists: /usr/local/share/man/man1/npm-adduser.1
npm ERR! Remove the existing file and try again, or run npm
npm ERR! with --force to overwrite files recklessly.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/albertvilacalvo/.npm/_logs/2020-01-13T11_55_47_922Z-debug.log
μ루μ μ μμ½νλ©΄ λ€μκ³Ό κ°μ΅λλ€.
brew reinstall node
npm i -g --force npm
μ΄κ²μ homebrew μ€μΉμμλ§ λ°μνλ κ²μ΄ μλλλ€. nodejs μ€μΉ νλ‘κ·Έλ¨ (곡μ μ¬μ΄νΈμμ)κ³Ό λμΌν λ¬Έμ κ° μμ΅λλ€. κ·Έλλ μμ μ μλν©λλ€ ... (sudo npm i -g --force npm)
npmμ μ λ°μ΄νΈνλ©΄ npmμ΄ μμ λ©λκΉ? κ·Έλ¦¬κ³ 12 μ μ΄νλ‘ μ ν΄μ Έ μμ§ μλμ?
npmμ μ λ°μ΄νΈνλ©΄ npmμ΄ μμ λ©λκΉ? κ·Έλ¦¬κ³ 12 μ μ΄νλ‘ μ ν΄μ Έ μμ§ μλμ?
λ€, MacOS 10.15.2μμλ λμκ² μΌμ΄λ¬μ΅λλ€.
λμκ²λ μΌμ΄λ¬λ€. MacOS μΉ΄ν리λ 10.15.3
μ΄κ²μ μ°λΆν¬μμ λμκ² μΌμ΄ λ¬μΌλ©° "brew"λ₯Ό μ¬μ©νμ§ μμ΅λλ€.
κ²°κ΅ npmμ λ€μ μ€μΉνλ €κ³ νμ§λ§ sudo μμ΄λ μ€μΉν μ μμμ΅λλ€. sudoμ ν¨κ» μ€μΉ ν λ€μ ~ / .npm λλ ν 리 (λ° κΈ°ν λͺ κ°)μ μμ κΆμ λμ°ΎκΈ°μν (λͺ λ°±νκ² λμ) κ°μ΄λλ₯Ό μ°Ύμμ΅λλ€. μ²μμλ μ¬μ ν μλνμ§ μμμ§λ§ hash -rμ΄ λ¬Έμ λ₯Ό ν΄κ²°νμ΅λλ€ (λμ 보면 Ubuntuλ₯Ό λ€μ μμν΄λ ν¨κ³Όκ°μμ μ μμ). μ΄λ‘ μΈν΄ react-snapκ³Ό κ΄λ ¨λ λ¬Έμ λ ν΄κ²° λ κ°λ₯μ±μ΄ ν¬λ°ν©λλ€.
μ΄ λ²κ·Έλ 2014 λ μλ³΄κ³ λμκ³ μ€λ 2020 λ μ μ μκ² λ°μνμ΅λλ€. μ λ§ μ¬μμ λλ€. μ΄ λ¬Έμ κ° ν΄κ²° λ κΉμ?
λλ homebrewμμ μ΅νΈ μμνκ³ λ¨μν https://github.com/nvm-sh/nvmμ μ¬μ©νμ΅λλ€.
κ·Έλ₯ ν΄
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.2/install.sh | bash
κ·Έλ¬λ©΄ μ΄λκ°μ
=> Compressing and cleaning up git repository => Appending nvm source string to /Users/aprilmintacpineda/.bash_profile => Appending bash_completion source string to /Users/aprilmintacpineda/.bash_profile => Close and reopen your terminal to start using nvm or run the following to use it now: export NVM_DIR="$HOME/.nvm" [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm [ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
source <name of profile>
λ΄ κ²½μ°<name of profile>
λ~/.bash_profile
μ΄λ―λ‘source ~/.bash_profile
κ·Έλ
nvm install node
λ Έλμ μ΅μ λ²μ μ μ€μΉνλ©΄ μ΅μ λ²μ μ npmλ μ€μΉλλ©° μ μκ² ν¨κ³Όμ μ΄μμ΅λλ€.
nvmμ μ¬μ©νλ κ²½μ° λ°μνμ§ μμ΅λλ€.
"nvmμ μ¬μ©νλ©΄ μ΄λ° μΌμ΄ λ°μνμ§ μμ΅λλ€."
μ, yarn
μ¬μ©νλ κ²½μ°μλ λ°μνμ§ μμ§λ§ κ΄λ ¨μ±μ΄ μλμ§ μ λͺ¨λ₯΄κ² μ΅λλ€.
그건 무κ΄νλ€κ³ μκ°ν©λλ€. NVMμ λ Έλ λ²μ κ΄λ¦¬μμ λλ€. brewλ₯Ό μ¬μ©νμ¬ λ Έλλ₯Ό μ€μΉν λ μ΄κ²μ κ²½ν ν λ€μ nvmμΌλ‘ μ ν ν ν μμ§ κ²½ννμ§ λͺ»νμ΅λλ€. https://github.com/nvm-sh/nvm#installing -and-updatingμ΄ λ¬΄μμΈμ§ λͺ¨λ₯΄λ κ²½μ° μ¬κΈ°μμ νμΈνμμμ€.
κ°μ₯ μ μ©ν λκΈ
μ루μ μ μμ½νλ©΄ λ€μκ³Ό κ°μ΅λλ€.