Home  >  Q&A  >  body text

node.js - centos6.8使用NVM安装nodejs,之后每次都提示/usr/bin/which: no node in...

黄舟黄舟2765 days ago1179

reply all(1)I'll reply

  • 天蓬老师

    天蓬老师2017-04-17 16:00:46

    Because nvm installs node in the subdirectory versions of the .nvm folder in the user's home directory, the path of the node is not added to the PATH
    So when executing which node, /usr/bin/which: no node in will appear (/usr/lib64/qt-3.3/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin)

    You only need to add the path to the directory where the node is located to PATH before executing which node.
    The which node command may be executed by nvm.
    The purpose may be to determine whether the node has been added to the environment variable. If not, add it.
    You can execute echo $PATH to see if the path to the directory where the node is located is in it

    reply
    0
  • Cancelreply