nvm

管理Node Js 版本

常用命令:

nvm list available

nvm install 版本号

nvm ls

nvm use

Node Version Manager (v0.40.2)

Note: <version> refers to any version-like string nvm understands. This includes:
  - full or partial version numbers, starting with an optional "v" (0.10, v0.1.2, v1)
  - default (built-in) aliases: node, stable, unstable, iojs, system
  - custom aliases you define with `nvm alias foo`

 Any options that produce colorized output should respect the `--no-colors` option.

Usage:
  nvm --help                                  Show this message
    --no-colors                               Suppress colored output
  nvm --version                               Print out the installed version of nvm
  nvm install [<version>]                     Download and install a <version>. Uses .nvmrc if available and version is omitted.
   The following optional arguments, if provided, must appear directly after `nvm install`:
    -s                                        Skip binary download, install from source only.
    -b                                        Skip source download, install from binary only.
    --reinstall-packages-from=<version>       When installing, reinstall packages installed in <node|iojs|node version number>
    --lts                                     When installing, only select from LTS (long-term support) versions
    --lts=<LTS name>                          When installing, only select from versions for a specific LTS line
    --skip-default-packages                   When installing, skip the default-packages file if it exists
    --latest-npm                              After installing, attempt to upgrade to the latest working npm on the given node version
    --no-progress                             Disable the progress bar on any downloads
    --alias=<name>                            After installing, set the alias specified to the version specified. (same as: nvm alias <name> <version>)
    --default                                 After installing, set default alias to the version specified. (same as: nvm alias default <version>)
    --save                                    After installing, write the specified version to .nvmrc
  nvm uninstall <version>                     Uninstall a version
  nvm uninstall --lts                         Uninstall using automatic LTS (long-term support) alias `lts/*`, if available.
  nvm uninstall --lts=<LTS name>              Uninstall using automatic alias for provided LTS line, if available.
  nvm use [<version>]                         Modify PATH to use <version>. Uses .nvmrc if available and version is omitted.
   The following optional arguments, if provided, must appear directly after `nvm use`:
    --silent                                  Silences stdout/stderr output
    --lts                                     Uses automatic LTS (long-term support) alias `lts/*`, if available.
    --lts=<LTS name>                          Uses automatic alias for provided LTS line, if available.
    --save                                    Writes the specified version to .nvmrc.
  nvm exec [<version>] [<command>]            Run <command> on <version>. Uses .nvmrc if available and version is omitted.
   The following optional arguments, if provided, must appear directly after `nvm exec`:
    --silent                                  Silences stdout/stderr output
    --lts                                     Uses automatic LTS (long-term support) alias `lts/*`, if available.
    --lts=<LTS name>                          Uses automatic alias for provided LTS line, if available.
  nvm run [<version>] [<args>]                Run `node` on <version> with <args> as arguments. Uses .nvmrc if available and version is omitted.
   The following optional arguments, if provided, must appear directly after `nvm run`:
    --silent                                  Silences stdout/stderr output
    --lts                                     Uses automatic LTS (long-term support) alias `lts/*`, if available.
    --lts=<LTS name>                          Uses automatic alias for provided LTS line, if available.
  nvm current                                 Display currently activated version of Node
  nvm ls [<version>]                          List installed versions, matching a given <version> if provided
    --no-colors                               Suppress colored output
    --no-alias                                Suppress `nvm alias` output
  nvm ls-remote [<version>]                   List remote versions available for install, matching a given <version> if provided
    --lts                                     When listing, only show LTS (long-term support) versions
    --lts=<LTS name>                          When listing, only show versions for a specific LTS line
    --no-colors                               Suppress colored output
  nvm version <version>                       Resolve the given description to a single local version
  nvm version-remote <version>                Resolve the given description to a single remote version
    --lts                                     When listing, only select from LTS (long-term support) versions
    --lts=<LTS name>                          When listing, only select from versions for a specific LTS line
  nvm deactivate                              Undo effects of `nvm` on current shell
    --silent                                  Silences stdout/stderr output
  nvm alias [<pattern>]                       Show all aliases beginning with <pattern>
    --no-colors                               Suppress colored output
  nvm alias <name> <version>                  Set an alias named <name> pointing to <version>
  nvm unalias <name>                          Deletes the alias named <name>
  nvm install-latest-npm                      Attempt to upgrade to the latest working `npm` on the current node version
  nvm reinstall-packages <version>            Reinstall global `npm` packages contained in <version> to current version
  nvm unload                                  Unload `nvm` from shell
  nvm which [current | <version>]             Display path to installed node version. Uses .nvmrc if available and version is omitted.
    --silent                                  Silences stdout/stderr output when a version is omitted
  nvm cache dir                               Display path to the cache directory for nvm
  nvm cache clear                             Empty cache directory for nvm
  nvm set-colors [<color codes>]              Set five text colors using format "yMeBg". Available when supported.
                                               Initial colors are:
                                                  bygre
                                               Color codes:
                                                r/R = red / bold red
                                                g/G = green / bold green
                                                b/B = blue / bold blue
                                                c/C = cyan / bold cyan
                                                m/M = magenta / bold magenta
                                                y/Y = yellow / bold yellow
                                                k/K = black / bold black
                                                e/W = light grey / white
Example:
  nvm install 8.0.0                     Install a specific version number
  nvm use 8.0                           Use the latest available 8.0.x release
  nvm run 6.10.3 app.js                 Run app.js using node 6.10.3
  nvm exec 4.8.3 node app.js            Run `node app.js` with the PATH pointing to node 4.8.3
  nvm alias default 8.1.0               Set default node version on a shell
  nvm alias default node                Always default to the latest available node version on a shell

  nvm install node                      Install the latest available version
  nvm use node                          Use the latest version
  nvm install --lts                     Install the latest LTS version
  nvm use --lts                         Use the latest LTS version

  nvm set-colors cgYmW                  Set text colors to cyan, green, bold yellow, magenta, and white

Note:
  to remove, delete, or uninstall nvm - just remove the `$NVM_DIR` folder (usually `~/.nvm`)

pake

网站打包

自定义参数(重点)

你可以使用 CLI 参数来自定义名称、图标、窗口大小、隐藏菜单等。

1️⃣ 常用参数示例:

pake https://github.com/tw93/Pake \
  --name "MyApp" \
  --icon "./icon.png" \
  --width 1280 \
  --height 800 \
  --transparent \
  --show-menu false

参数

说明

--name

指定应用名称

--icon

指定应用图标路径(支持 .png/.ico)

--width

默认窗口宽度

--height

默认窗口高度

--transparent

是否启用透明窗口

--show-menu false

是否隐藏系统菜单栏

--user-agent

自定义 UA

--multi-arch

打包多架构(如 M1 + Intel)

--fullscreen

是否全屏启动

pyenv

python环境管理

查看现在使用的python版本

$ pyenv version

查看可供pyenv使用的python版本

$ pyenv versions

安装python版本

$ pyenv install <python版本>

安装的版本会在~/.pyenv/versions目录下。

对于比较大的版本文件,例如anaconda,可以先到官网下载,然后将文件放在~/.pyenv/cache目录下,再执行安装命令时,pyenv不会重复下载。

此外,可以用--list参数查看所以可以安装的版本

$ pyenv install --list

卸载将install改为uninstall就行

$ pyenv uninstall <python版本>

设置全局python版本,一般不建议改变全局设置

$ pyenv global <python版本>

设置局部python版本

$ pyenv local <python版本>

设置之后可以在目录内外分别试下which pythonpython --version看看效果, 如果没变化的话可以$ python rehash之后再试试

Jenv

使用以下命令将 Java 版本添加到 jEnv 中:

jenv add /path/to/java/home

添加 Java 版本到 jEnv 后,你可以轻松切换当前使用的 Java 版本。

列出所有可用的 Java 版本

jenv versions

设置全局 Java 版本

jenv global 1.8

设置局部(项目级)Java 版本

jenv local 11.0

设置 Shell 级 Java 版本

jenv shell 11.0

验证当前使用的 Java 版本

在切换 Java 版本后,你可能想要验证当前使用的是哪个版本。可以使用以下命令:

java -version

homebrew

🍺 一、基础操作

命令

说明

brew -v

查看 Homebrew 版本

brew update

更新 Homebrew 自身(即更新仓库信息)

brew upgrade

更新所有已安装的软件包

brew upgrade <包名>

更新指定软件

brew doctor

检查系统与 Homebrew 环境问题(非常实用)

brew help

查看帮助文档


📦 二、软件管理命令

命令

说明

brew search <关键字>

搜索可安装的软件

brew info <包名>

查看软件的详细信息、版本、安装路径

brew install <包名>

安装软件

brew uninstall <包名>

卸载软件

brew list

查看所有已安装软件

brew list <包名>

查看该软件安装了哪些文件

brew reinstall <包名>

重新安装(修复损坏时常用)


🧹 三、清理与维护命令

命令

说明

brew cleanup

清理旧版本、缓存文件

brew autoremove

移除无用的依赖包

brew cleanup -n

预览清理内容,不执行删除

brew leaves

查看用户显式安装的软件(非依赖)

brew deps --tree <包名>

查看依赖树


⚙️ 四、服务管理命令(针对后台服务)

命令

说明

brew services list

查看所有通过 brew 安装的服务状态

brew services start <服务名>

启动服务

brew services stop <服务名>

停止服务

brew services restart <服务名>

重启服务

brew services cleanup

清理无用的服务配置


🧩 五、Cask(图形应用管理)

命令

说明

brew install --cask <app>

安装图形界面应用(如 Chrome、VSCode)

brew uninstall --cask <app>

卸载 GUI 应用

brew list --cask

查看所有通过 cask 安装的 GUI 应用