1.执行以下命令,查看是否安装homebrew
brew -v
结果
ios001@bogon ~ % brew -v
Homebrew 2.4.16
Homebrew/homebrew-core (git revision 85bdb1; last commit 2020-09-06)
2.没有安装就进行homebrew
安装
去homebrew官网或者参考homebrew安装
3.安装了homebrew
就先执行以下命令更新
brew update
执行结果
ios001@bogon ~ % brew update
Updated 1 tap (homebrew/core).
==> New Formulae
alsa-lib libhandy libxshmfence
asroute libice libxt
blaze libirecovery libxtst
box2d libmnl libxv
cloudformation-guard libnetfilter-queue libxvmc
commitizen libnfnetlink libxxf86dga
croc libpciaccess libxxf86vm
cvs-fast-export libpthread-stubs matplotplusplus
dbdeployer libseccomp or-tools
device-mapper libsm postgresql@12
dotnet libx11 prometheus-cpp
envoy libxau protoc-gen-go-grpc
fleet-cli libxaw python@3.9
flit libxaw3d rustscan
font-util libxcb server-go
foreman libxcomposite shtools
fpart libxcursor structurizr-cli
gcalcli libxdamage terrascan
git-hound libxdmcp tfsec
gitql libxext trunk
googletest libxfixes util-macros
gost libxfont vivid
halide libxft vtk@8.2
infracost libxi webify
ladspa-sdk libxinerama x86_64-elf-gdb
leaf libxkbfile xcb-proto
libaio libxmu xdpyinfo
libdmx libxpm xorgproto
libdrm libxrandr xtrans
libfontenc libxrender zsh-you-should-use
libfs libxres
libgccjit libxscrnsaver
==> Updated Formulae
openssl@1.1 ✔ libmspub
p11-kit ✔ libmtp
unbound ✔ libmwaw
abcmidi libmxml
abseil libnetworkit
abyss libngspice
acl2 libolm
acpica libomp
act libopenmpt
adwaita-icon-theme liboqs
aliyun-cli libp11
allure libpeas
alpine libphonenumber
amtk libplctag
angular-cli libpq
anime-downloader libpqxx
ansible libqalculate
ansible-lint libraw
ansifilter librsvg
ant libsecret
apache-flink libshout
apache-geode libsigc++
apache-spark libsigc++@2
apibuilder-cli libsndfile
apollo-cli libsoup
appstream-glib libspectre
arangodb libspng
aravis libssh
archiver libstrophe
arduino-cli libtcod
argo libtensorflow
argocd libtensorflow@1
arm-linux-gnueabihf-binutils libtins
artifactory libtorrent-rasterbar
arx-libertatis libuv
asciidoc libvirt
asciidoctorj libvirt-glib
asciinema libxkbcommon
asdf libxlsxwriter
ask-cli libxml++
atdtool libxml++3
athenacli link-grammar
atlassian-cli liquibase
auditbeat liquidctl
austin litecli
autodiff livestreamer
autojump lizard-analyzer
autopep8 llvm
autorest lmod
aws-cdk lnav
aws-elasticbeanstalk localstack
aws-es-proxy logstalgia
aws-google-auth logstash
aws-iam-authenticator luarocks
aws-okta lxc
aws-sdk-cpp lynis
aws-shell mackup
awscli macvim
awscli@1 magic-wormhole
awscurl mame
awslogs manticoresearch
awsume mariadb
awsweeper mariadb-connector-c
azure-cli mariadb@10.1
b2-tools mariadb@10.2
b3sum mariadb@10.3
babel mariadb@10.4
babl marked
bacula-fd mas
bagit mavsdk
balena-cli mbedtls
bandcamp-dl mcabber
bandwhich mdbook
baobab mdcat
bartycrouch mdk
basex media-info
bash-preexec meilisearch
bat memcached
bazel memtester
bazelisk mercurial
bcftools mesa
bcpp meson
beancount mesos
bear metabase
bedtools metaproxy
benthos metricbeat
bento4 micro
binaryen micronaut
bind micropython
bindfs mikutter
binutils minikube
biosig minio
bison minio-mc
bitrise minizinc
bitwarden-cli minizip2
black mitie
blastem mkdocs
bloaty mkvtoolnix
blogc mlt
bnd mlton
bnfc mm-common
borgbackup mmark
borgmatic mmseqs2
botan mockolo
bowtie2 modules
broot molecule
buildifier monero
buildozer mongo-c-driver
buku mongo-orchestration
bumpversion mono
bundletool mpd
byacc mps-youtube
bzt mrboom
c-ares mtr
c-blosc mujs
c7n mupdf
caddy mupdf-tools
cadence mycli
caffe mypy
cake naabu
calabash nano
calcurse nanopb-generator
calicoctl nanorc
camlp5 navi
cargo-c nbdime
cargo-instruments ncmpc
carla nco
carrot2 nebula
carthage neo4j
castxml neomutt
catch2 netdata
catimg netlify-cli
cbmc netpbm
ccache networkit
ccls newrelic-cli
ccm newsboat
cddlib nexus
cdk8s nfpm
ceres-solver nghttp2
cern-ndiff nginx
certbot ngt
cfn-lint nicovideo-dl
cgal nifi
chakra nim
chamber ninja
chapel nlohmann-json
chart-testing nmap
checkstyle node
chezmoi node-build
choose node-sass
choose-gui node@10
chronograf node@12
chrony nomad
circleci noti
citus notifiers
cjdns notmuch
cksfv nsd
clamav nspr
claws-mail nss
clib numcpp
cloc numpy
clojure nushell
clojure-lsp nvm
closure-compiler nwchem
cloud-nuke nyx
cloudformation-cli ocamlsdl
cmake oci-cli
cnats ocrmypdf
cobalt octant
coconut octave
code-server odin
codemod oha
codespell oil
comby okteto
composer onednn
conan onefetch
conjure-up opa
consul open-image-denoise
container-structure-test openblas
contentful-cli openclonk
convox opencsg
cookiecutter opencv
copilot opencv@3
coredns openfast
cortex openfortivpn
couchdb openldap
cowsay openlibm
cppcheck openmsx
cppman openrct2
cproto openssh
cpu_features openstackclient
credstash operator-sdk
cromwell orc
crowdin orientdb
csvkit ormolu
csvtomd ory-hydra
ctemplate osc
cubejs-cli osm
cucumber-ruby osmosis
curl packer
curl-openssl packetbeat
cutter pam-u2f
cypher-shell pango
dar pangomm
dartsim pass-git-helper
dasm passenger
datasette pastebinit
ddgr pax-construct
deark pc6001vx
debianutils pcl
deheader pdal
deno pdfcpu
dependency-check pdftk-java
detekt pdftoipe
devspace pdns
dfmt percol
dgraph perltidy
dhall peru
dhall-bash petsc
dhall-json petsc-complex
dhall-lsp-server pgcli
dhall-yaml pgpool-ii
diceware php
diff-pdf php@7.3
diffoscope phpmd
direnv phpmyadmin
diskonaut phpstan
dita-ot phpunit
django-completion picard-tools
dmd pioneer
dmenu pipenv
dnscontrol pipgrip
dnsdist pipx
dnstwist pius
dnsviz pla
docfx plantuml
docker platformio
docker-completion pmd
docker-compose pnpm
docker-compose-completion podman
docker-machine-parallels poetry
docker-squash polynote
doctl ponyc
doitlive ponysay
dolt poppler
dos2unix postgis
dosbox-x postgresql
dssim powerline-go
dub ppsspp
duck pre-commit
duckscript prest
duplicity prestosql
dvc prettier
dxpy procs
dyld-headers prometheus
earthly proselint
easyengine proteinortho
easyrpg-player protoc-gen-go
eccodes proxytunnel
efl pspg
eg-examples pssh
eigen pueue
ejdb pulledpork
eksctl pulumi
elasticsearch pumba
elixir pwncat
elm-format pwntools
embree py3cairo
embulk pyenv
emscripten pygitup
enchant pygments
ensmallen pygobject3
ephemeralpg pyinstaller
eralchemy pyinvoke
erlang pylint
erlang@21 pyqt
erlang@22 pyside
eslint python-markdown
esptool python-yq
ethereum python@3.7
euler-py python@3.8
evince pyvim
expat q
exploitdb qbs
eye-d3 qca
faas-cli qmmp
fabio qrcp
fabric qrencode
fades qt
fastlane qtkeychain
fastmod quickjs
faudio quill
fava r
fb-client rabbitmq
fbi-servefiles radare2
fblog rav1e
fdk-aac-encoder raxml-ng
fetchmail rbtools
fff rclone
ffmpeg rcm
ffsend re-flex
file-roller re2
filebeat reattach-to-user-namespace
findomain recon-ng
firebase-cli redis
flake8 redo
flank remarshal
flarectl reorder-python-imports
flawfinder repo
flintrock reposurgeon
flow restic
fluent-bit restview
fluid-synth riemann
fluxctl rke
flyway robot-framework
fn rom-tools
folly root
fonttools rqlite
fortio rst-lint
fpp rtv
freediameter rubberband
freeswitch ruby
freetds ruby-build
freetype rust
frpc rust-analyzer
frps s3-backer
frugal safe-rm
fs-uae samtools
fselect sbcl
functionalplus sbt
futhark scamper
fx scc
fzf sceptre
game-music-emu scour
gammaray scummvm
gammu scummvm-tools
gandi.cli scw
gateway-go sdl
gatsby-cli sdl_mixer
gau sdlpop
gauge seal
gcc@5 semgrep
gcovr sentencepiece
gdal ser2net
gdbgui serf
gdcm serverless
gedit sfcgal
geogram sfk
geoserver shadowsocks-libev
geph2 shallow-backup
gh sheldon
ghc shyaml
ghc@8.6 signal-cli
ghc@8.8 sile
ghostscript simple-scan
ghz simutrans
ghz-web singular
gifski sipp
gimme-aws-creds siril
ginac sispmctl
git sk
git-absorb skaffold
git-annex skopeo
git-cola skylighting
git-delta sleef
git-extras sleuthkit
git-filter-repo snakemake
git-gui snapcraft
git-plus solidity
git-remote-codecommit solr
git-review solr@7.7
git-revise sonar-scanner
git-trim sonarqube
gitlab-runner sops
gitmoji sord
gitup source-to-image
gitversion sourcekitten
gjs spdlog
glade sphinx-doc
glances spice-protocol
glew spirv-cross
glib spoof-mac
glib-networking spotbugs
glooctl spotify-tui
gloox sql-translator
glow sqlite-utils
gnome-latex sqlmap
gnu-units sqlparse
gnunet sratom
gnuradio srt
go ssdb
go-jira ssh-audit
go@1.14 sshuttle
gobject-introspection sslh
gobuster sslmate
godep sslscan
golang-migrate sslyze
golangci-lint starship
google-benchmark staticcheck
googler statik
goolabs stella
gor stellar-core
goreleaser stone-soup
gostatic stormssh
gource streamlink
gpac stress-ng
gphoto2 stunnel
gr-osmosdr subfinder
gradle subliminal
gradle-profiler suil
grafana sundials
grakn supertux
graph-tool suricata
graphql-cli svtplay-dl
grc swagger-codegen
grep swagger-codegen@2
grin swaks
grip swift-protobuf
gromacs swift-sh
groonga swiftformat
groovy swiftgen
groovysdk swiftlint
grpc sync_gateway
grpcui syncthing
gsettings-desktop-schemas syntaxerl
gsoap talisman
gst-editing-services tanka
gst-libav tarsnapper
gst-plugins-bad taskell
gst-plugins-base tbb
gst-plugins-good tectonic
gst-plugins-ugly tee-clc
gst-python tektoncd-cli
gst-rtsp-server telegraf
gstreamer teleport
gtksourceview4 tengo
gtranslator tepl
h3 termius
hadolint termshark
haproxy termtosvg
hashpump terraform
hasura-cli terraform-docs
haxe terraform-ls
hbase terraform-provider-libvirt
hcxtools terraformer
hdf5@1.10 terragrunt
heartbeat terrahub
hebcal tflint
helib thanos
helm tiger-vnc
helm@2 tile38
helmfile tintin
helmsman toast
hfstospell todoman
highlight tomcat
hledger tomcat-native
hlint tomcat@7
homeassistant-cli tomcat@8
homebank toot
honcho topgrade
howdoi tor
hsd tox
htmldoc traefik
htop trailscraper
htslib transcrypt
httpie translate-toolkit
httpstat trash-cli
httpx tre-command
hugo trezor-agent
hwloc tth
hy tvnamer
hyperfine twarc
hyperkit twine-pypi
hypre twoping
i686-elf-binutils txr
ibex txt2tags
iblinter typescript
idnits u-boot-tools
igraph ucloud
imagemagick ugrep
imagemagick@6 ultralist
immudb ungit
influxdb unixodbc
inko unoconv
inlets upscaledb
insect urh
instalooter usb.ids
internetarchive v8
ios-deploy vala
ipfs vale
ipmiutil varnish
iproute2mac vault
ircd-hybrid vdirsyncer
ispc vegeta
istioctl velero
itk verilator
jailkit vert.x
janet vgmstream
jasper vim
jbig2dec vips
jc visp
jdupes vnu
jenkins vpn-slice
jenkins-job-builder vroom
jenkins-lts vsts-cli
jetty vte3
jetty-runner vtk
jfrog-cli vttest
jhipster vulkan-headers
jinja2-cli wakatime-cli
jinx watchexec
jsdoc3 watchman
json-glib watson
jsoncpp weboob
jsonrpc-glib webpack
jsvc weechat
juju wellington
juju-wait wgcf
jupyterlab wgetpaste
just whalebrew
k3d whatmp3
k6 whistle
k9s whois
kamel widelands
kcptun wildfly-as
kde-extra-cmake-modules wireguard-tools
kde-karchive wiremock-standalone
kde-kdoctools wireshark
kde-ki18n wownero
kde-threadweaver wsk
keepkey-agent wskdeploy
kepubify wtf
keydb wtfutil
khal wxmaxima
khard x3270
kibana x86_64-elf-binutils
kibana@6 xclogparser
kind xcodegen
kitchen-sync xgboost
knot xmake
knot-resolver xmrig
kops xonsh
kore xtensor
kotlin xxh
kpcli yaegi
krakend yamllint
ktlint yapf
kube-aws yarn
kubeaudit yaws
kubernetes-cli yazpp
kubeseal ydcv
kubespy ydiff
kumactl yelp-tools
kustomize yeti
languagetool ykpers
lanraragi yle-dl
lazygit yosys
leakcanary-shark you-get
lean-cli youtube-dl
legit yq
lf z3
libcbor z80dasm
libcouchbase zabbix
libdazzle zabbix-cli
libde265 zebra
libdnet zeek
libexosip zenith
libfabric zeromq
libfido2 zim
libgphoto2 zint
libgr znc
libhdhomerun zola
libheif zookeeper
libjwt zurl
liblouis
==> Renamed Formulae
gst-validate -> gst-devtools
==> Deleted Formulae
meson-internal xu4
4.再次查看homebrew
版本
ios001@bogon ~ % brew -v
Homebrew 2.5.6
Homebrew/homebrew-core (git revision e27c5d; last commit 2020-10-20)
5.执行以下命令安装node
brew install node
结果
ios001@bogon ~ % brew install node
Updating Homebrew...
==> Downloading https://homebrew.bintray.com/bottles/icu4c-67.1.catalina.bottle.
==> Downloading from https://d29vzk4ow07wi7.cloudfront.net/2d1e91b5127f66e794179
######################################################################## 100.0%
==> Downloading https://homebrew.bintray.com/bottles/node-14.14.0.catalina.bottl
==> Downloading from https://d29vzk4ow07wi7.cloudfront.net/f1be3b305c38cc1a71cc0
######################################################################## 100.0%
==> Installing dependencies for node: icu4c
==> Installing node dependency: icu4c
==> Pouring icu4c-67.1.catalina.bottle.tar.gz
==> Caveats
icu4c is keg-only, which means it was not symlinked into /usr/local,
because macOS provides libicucore.dylib (but nothing else).
If you need to have icu4c first in your PATH run:
echo 'export PATH="/usr/local/opt/icu4c/bin:$PATH"' >> ~/.zshrc
echo 'export PATH="/usr/local/opt/icu4c/sbin:$PATH"' >> ~/.zshrc
For compilers to find icu4c you may need to set:
export LDFLAGS="-L/usr/local/opt/icu4c/lib"
export CPPFLAGS="-I/usr/local/opt/icu4c/include"
For pkg-config to find icu4c you may need to set:
export PKG_CONFIG_PATH="/usr/local/opt/icu4c/lib/pkgconfig"
==> Summary
🍺 /usr/local/Cellar/icu4c/67.1: 258 files, 71.2MB
==> Installing node
==> Pouring node-14.14.0.catalina.bottle.tar.gz
==> Caveats
Bash completion has been installed to:
/usr/local/etc/bash_completion.d
==> Summary
🍺 /usr/local/Cellar/node/14.14.0: 4,698 files, 64.0MB
==> `brew cleanup` has not been run in 30 days, running now...
Removing: /Users/ios001/Library/Caches/Homebrew/coreutils--8.32.catalina.bottle.tar.gz... (3.8MB)
Removing: /Users/ios001/Library/Caches/Homebrew/openssl@1.1--1.1.1g.catalina.bottle.tar.gz... (5.3MB)
Removing: /Users/ios001/Library/Caches/Homebrew/p11-kit--0.23.20_1.catalina.bottle.tar.gz... (707.6KB)
Removing: /Users/ios001/Library/Caches/Homebrew/unbound--1.11.0.catalina.bottle.tar.gz... (2.6MB)
Removing: /Users/ios001/Library/Logs/Homebrew/pkg-config... (64B)
Removing: /Users/ios001/Library/Logs/Homebrew/libtool... (64B)
Removing: /Users/ios001/Library/Logs/Homebrew/coreutils... (64B)
Removing: /Users/ios001/Library/Logs/Homebrew/gmp... (64B)
Removing: /Users/ios001/Library/Logs/Homebrew/pinentry... (64B)
Removing: /Users/ios001/Library/Logs/Homebrew/libidn2... (64B)
Removing: /Users/ios001/Library/Logs/Homebrew/libksba... (64B)
Removing: /Users/ios001/Library/Logs/Homebrew/nettle... (64B)
Removing: /Users/ios001/Library/Logs/Homebrew/libunistring... (64B)
Removing: /Users/ios001/Library/Logs/Homebrew/libyaml... (64B)
Removing: /Users/ios001/Library/Logs/Homebrew/bdw-gc... (64B)
Removing: /Users/ios001/Library/Logs/Homebrew/readline... (64B)
Removing: /Users/ios001/Library/Logs/Homebrew/libassuan... (64B)
Removing: /Users/ios001/Library/Logs/Homebrew/libgpg-error... (64B)
Removing: /Users/ios001/Library/Logs/Homebrew/zlib... (64B)
Removing: /Users/ios001/Library/Logs/Homebrew/libgcrypt... (64B)
Removing: /Users/ios001/Library/Logs/Homebrew/gettext... (64B)
Removing: /Users/ios001/Library/Logs/Homebrew/autoconf... (64B)
Removing: /Users/ios001/Library/Logs/Homebrew/libtasn1... (64B)
Removing: /Users/ios001/Library/Logs/Homebrew/libevent... (64B)
Removing: /Users/ios001/Library/Logs/Homebrew/openssl@1.1... (64B)
Removing: /Users/ios001/Library/Logs/Homebrew/unbound... (64B)
Removing: /Users/ios001/Library/Logs/Homebrew/libusb... (64B)
Removing: /Users/ios001/Library/Logs/Homebrew/guile... (64B)
Removing: /Users/ios001/Library/Logs/Homebrew/gnupg... (64B)
Removing: /Users/ios001/Library/Logs/Homebrew/p11-kit... (64B)
Removing: /Users/ios001/Library/Logs/Homebrew/automake... (64B)
Removing: /Users/ios001/Library/Logs/Homebrew/libffi... (64B)
Removing: /Users/ios001/Library/Logs/Homebrew/gnutls... (64B)
Removing: /Users/ios001/Library/Logs/Homebrew/npth... (64B)
Removing: /Users/ios001/Library/Logs/Homebrew/adns... (64B)
Pruned 0 symbolic links and 3 directories from /usr/local
==> Caveats
==> icu4c
icu4c is keg-only, which means it was not symlinked into /usr/local,
because macOS provides libicucore.dylib (but nothing else).
If you need to have icu4c first in your PATH run:
echo 'export PATH="/usr/local/opt/icu4c/bin:$PATH"' >> ~/.zshrc
echo 'export PATH="/usr/local/opt/icu4c/sbin:$PATH"' >> ~/.zshrc
For compilers to find icu4c you may need to set:
export LDFLAGS="-L/usr/local/opt/icu4c/lib"
export CPPFLAGS="-I/usr/local/opt/icu4c/include"
For pkg-config to find icu4c you may need to set:
export PKG_CONFIG_PATH="/usr/local/opt/icu4c/lib/pkgconfig"
==> node
Bash completion has been installed to:
/usr/local/etc/bash_completion.d
6.查看nmp版本
ios001@bogon ~ % npm -v
6.14.8
7.更新nmp
npm install -g npm
结果
ios001@bogon ~ % 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@6.14.8
updated 1 package in 11.218s
网友评论