linux:nvm

差分

このページの2つのバージョン間の差分を表示します。

この比較画面へのリンク

次のリビジョン
前のリビジョン
linux:nvm [2020/06/15 04:06] – 作成 ともやんlinux:nvm [2020/09/11 17:03] (現在) ともやん
行 30: 行 30:
 [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"  # This loads 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 [ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"  # This loads nvm bash_completion
 +</code>
 +</WRAP>
 +
 +実行後は **~/.bashrc** に **nvm** の設定が追加されるので、端末を再起動するか **~/.bashrc** を手動で実行する。\\
 +<WRAP prewrap 100%>
 +<code bash>
 +$ cat ~/.bashrc
 +</code>
 +</WRAP>
 +<WRAP prewrap 100% #result>
 +<code bash>
 +# .bashrc
 +
 +# Source global definitions
 +if [ -f /etc/bashrc ]; then
 +        . /etc/bashrc
 +fi
 +
 +# User specific environment
 +PATH="$HOME/.local/bin:$HOME/bin:$PATH"
 +export PATH
 +
 +# Uncomment the following line if you don't like systemctl's auto-paging feature:
 +# export SYSTEMD_PAGER=
 +
 +# User specific aliases and functions
 +
 +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
 +</code>
 +</WRAP>
 +
 +**~/.bashrc** を手動で実行する。\\
 +<WRAP prewrap 100%>
 +<code bash>
 +$ . ~/.bashrc
 +</code>
 +</WRAP>
 +
 +**nvm** の動作確認。\\
 +<WRAP prewrap 100%>
 +<code bash>
 +$ nvm --version
 +</code>
 +</WRAP>
 +<WRAP prewrap 100%>
 +<code bash>
 +0.35.3
 +</code>
 +</WRAP>
 +※Linux の **nvm** では、バージョン確認は **--version** オプションである。\\
 +<WRAP prewrap 100%>
 +<code bash>
 +$ nvm --help
 +</code>
 +</WRAP>
 +<WRAP prewrap 100% #result_long>
 +<code bash>
 +Node Version Manager (v0.35.3)
 +
 +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
 +  nvm --version                             Print out the installed version of nvm
 +  nvm install [-s] <version>                Download and install a <version>, [-s] from source. Uses .nvmrc if available
 +    --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
 +  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 [--silent] <version>              Modify PATH to use <version>. Uses .nvmrc if available
 +    --lts                                   Uses automatic LTS (long-term support) alias `lts/*`, if available.
 +    --lts=<LTS name>                        Uses automatic alias for provided LTS line, if available.
 +  nvm exec [--silent] <version> [<command>] Run <command> on <version>. Uses .nvmrc if available
 +    --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 [--silent] <version> [<args>    Run `node` on <version> with <args> as arguments. Uses .nvmrc if available
 +    --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
 +  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
 +  nvm cache dir                             Display path to the cache directory for nvm
 +  nvm cache clear                           Empty cache directory for nvm
 +
 +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
 +
 +Note:
 +  to remove, delete, or uninstall nvm - just remove the `$NVM_DIR` folder (usually `~/.nvm`)
 </code> </code>
 </WRAP> </WRAP>
  • linux/nvm.1592161575.txt.gz
  • 最終更新: 2020/06/15 04:06
  • by ともやん