听说Brew在Linux上可用,所以我打算试一试

安装brew

在终端中输入此处所写的命令。
https://brew.sh/

$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  To install Linuxbrew, paste at a terminal prompt:
    sh -c "$(curl -fsSL https://raw.githubusercontent.com/Linuxbrew/install/master/install.sh)"

只需要在Linux终端键入以下命令:sh -c “$(curl -fsSL https//raw.githubusercontent.com/~~~”。

$ sh -c "$(curl -fsSL https://raw.githubusercontent.com/Linuxbrew/install/master/install.sh)"
==> This script will install:
/home/linuxbrew/.linuxbrew/bin/brew
/home/linuxbrew/.linuxbrew/share/doc/homebrew
/home/linuxbrew/.linuxbrew/share/man/man1/brew.1
/home/linuxbrew/.linuxbrew/share/zsh/site-functions/_brew
/home/linuxbrew/.linuxbrew/etc/bash_completion.d/brew
/home/ryicoh/.cache/Homebrew/
/home/linuxbrew/.linuxbrew/Homebrew

Press RETURN to continue or any other key to abort
==> Downloading and installing Linuxbrew...
remote: Enumerating objects: 150, done.
remote: Counting objects: 100% (150/150), done.
remote: Compressing objects: 100% (23/23), done.
remote: Total 169 (delta 125), reused 150 (delta 125), pack-reused 19
Receiving objects: 100% (169/169), 35.68 KiB | 0 bytes/s, done.
Resolving deltas: 100% (126/126), completed with 41 local objects.
From https://github.com/Homebrew/brew
   3349da1..2f79f5b  master     -> origin/master
 * [new tag]         2.0.1      -> 2.0.1
HEAD is now at 2f79f5b Merge pull request #5708 from Homebrew/dependabot/bundler/docs/github-pages-194

到这里停下来没进去啊。。
以为不行,结果居然过去了!!!
看起来要花很多时间。。

'
Updated 1 tap (homebrew/core).
==> New Formulae
apache-arrow        apache-arrow-glib   bumpversion         cassandra-reaper    cstore_fdw          diskus              git-absorb          jinja2-cli          jp                  ladspa-sdk          ungit               usbredir
==> Updated Formulae
binutils ✔              certbot                 direnv                  go@1.10                 kube-aws                lighttpd                mrboom                  phpunit                 safe                    urbit
curl ✔                  cglm                    efl                     gomplate                kubeless                linkerd                 mysql                   pipenv                  sccache                 vips
algernon                clutter-gst             elasticsearch           gradle                  kubernetes-cli          lxc                     nats-streaming-server   pony-stable             scipy                   wget
angular-cli             cmus                    etcd                    gtk+3                   kustomize               macvim                  ncdu                    poppler                 siril                   whois
apache-opennlp          cocoapods               exploitdb               hcloud                  ledger                  math-comp               ngircd                  postgresql@9.4          sphinx                  xsimd
awscli                  conan                   ffmpeg                  highlight               libidn2                 maxima                  nim                     prettier                sphinx-doc              xtensor
bartycrouch             conjure-up              firebase-cli            htop                    libosinfo               maxwell                 ocrmypdf                prometheus              streamlink              youtube-dl
bat                     convox                  fn                      httpd                   libphonenumber          meson                   opendetex               pulumi                  swift-protobuf          zsh
bazel                   coq                     fonttools               ice                     libpsl                  metricbeat              openimageio             rabbitmq                swiftformat
bettercap               cromwell                frugal                  igv                     libraw                  minio                   osrm-backend            rawtoaces               syncthing
bison                   cryfs                   futhark                 imagemagick             librealsense            minio-mc                pandoc-citeproc         rclone                  telegraf
bit                     crystal                 fx                      inetutils               libssh                  mkcert                  pdftoedn                rebar3                  terraform_landscape
bluetoothconnector      curl-openssl            git-extras              ipv6calc                libtiff                 mkl-dnn                 pdftoipe                repo                    tgui
caddy                   cython                  git-quick-stats         jenkins                 libu2f-host             mosquitto               pgweb                   rom-tools               timidity
cassandra@2.1           devd                    gmsh                    kibana                  libvirt                 mpd                     php                     rtags                   tomcat
cassandra@2.2           diff-pdf                gnatsd                  kotlin                  libvpx                  mpv                     php@7.2                 rtv                     upx
==> Renamed Formulae
resin-cli -> balena-cli
==> Installation successful!

==> Homebrew has enabled anonymous aggregate formulae and cask analytics.
Read the analytics documentation (and how to opt-out) here:
  https://docs.brew.sh/Analytics.html

==> Homebrew is run entirely by unpaid volunteers. Please consider donating:
  https://github.com/Homebrew/brew#donations
==> Next steps:
- Install the Linuxbrew dependencies if you have sudo access:
  Debian, Ubuntu, etc.
    sudo apt-get install build-essential
  Fedora, Red Hat, CentOS, etc.
    sudo yum groupinstall 'Development Tools'
  See http://linuxbrew.sh/#dependencies for more information.
- Add Linuxbrew to your ~/.profile by running
    echo 'eval $(/home/linuxbrew/.linuxbrew/bin/brew shellenv)' >>~/.profile
- Add Linuxbrew to your PATH
    PATH="/home/linuxbrew/.linuxbrew/bin:$PATH"
- We recommend that you install GCC by running:
    brew install gcc
- After modifying your shell profile, you may need to restart your session
  (logout and then log back in) if the brew command isn't found.
- Run `brew help` to get started
- Further documentation:
    https://docs.brew.sh
Warning: /home/linuxbrew/.linuxbrew/bin is not in your PATH.

设置依赖软件或环境变量

sudo yum groupinstall 'Development Tools'
echo 'eval $(/home/linuxbrew/.linuxbrew/bin/brew shellenv)' >>~/.profile
PATH="/home/linuxbrew/.linuxbrew/bin:$PATH"
brew install gcc

试试看

$ brew install nodejs
$ npm -v
6.5.0
广告
将在 10 秒后关闭
bannerAds