exectuable path pointing to the wrong location, how do I update

前端 未结 2 1322
故里飘歌
故里飘歌 2021-01-24 21:51

I recently updated a nodejs executable using npm and now the executable is pointing to the wrong location. when I run the which command in terminal it is pointing to the old no

相关标签:
2条回答
  • 2021-01-24 22:43

    I don't think which ever returns something that doesn't exist. It shows you which version of the executable is being found, based on the search order in your $PATH environment variable.

    This $PATH variable is set in your shell. Type $PATH in the terminal to see what your path variable is set to. (Probably something like /usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin)

    See this question for some instructions to change your shell path variable: Set environment variables on Mac OS X Lion

    Can you give more specific examples of where this stuff is, and what files you are looking at, because I don't think your description makes sense (with regard to "pointing to the old non-existant location")?

    0 讨论(0)
  • 2021-01-24 22:52

    bash caches the paths to executables you've run. You can reset the cache with "hash -r" (or start a new bash session or terminal).

    0 讨论(0)
提交回复
热议问题