【问题标题】:Trying to install nvm尝试安装 nvm
【发布时间】:2020-07-01 15:21:34
【问题描述】:

我正在尝试安装 nvm,但不断出现错误。

我运行安装脚本

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash

我明白了

=> nvm is already installed in /Users/xxxxx/.nvm, trying to update using git
=> => Compressing and cleaning up git repository

=> nvm source string already in /Users/xxxxx/.bash_profile
=> bash_completion source string already in /Users/xxxxx/.bash_profile
=> You currently have modules installed globally with `npm`. These will no
=> longer be linked to the active version of Node when you install a new node
=> with `nvm`; and they may (depending on how you construct your `$PATH`)
=> override the binaries of modules installed with `nvm`:

/Users/xxxxx/.nvm/versions/node/v10.17.0/lib
└── yarn@1.22.4
=> If you wish to uninstall them at a later point (or re-install them under your
=> `nvm` Nodes), you can remove them from the system Node as follows:

     $ nvm use system
     $ npm uninstall -g a_module

=> 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

如果我关闭并打开一个新的终端窗口并使用 nvm -v 检查 nvm

我明白了

zsh: command not found: nvm

【问题讨论】:

    标签: node.js macos nvm


    【解决方案1】:

    Mac OS 修复

    export NVM_DIR=~/.nvm
    source ~/.nvm/nvm.sh
    

    在此关闭终端后再次打开。

    瞧,它应该像魅力一样工作

    【讨论】:

      猜你喜欢
      • 2017-09-21
      • 1970-01-01
      • 1970-01-01
      • 2015-02-23
      • 1970-01-01
      • 2016-02-17
      • 2018-05-12
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多