运行时节点版本与 node -v returns 不同 - husky 不能 运行 git hooks

Runtime node version is different than what node -v returns - husky can't run git hooks

Husky requires Node 10 (runtime: v8.10.0), can't run Git hook.

节点-v:v12.20.1 sudo node -v: v8.10.0

任何人都知道如何解决这个问题或实际发生了什么?因此,我根本无法在 phpstorm 中使用 git。

从 desktop/System menu/Toolbox 启动时,WebStorm 只能看到在登录 shell 中配置的环境变量,但看不到交互式 shell 配置文件(如 .bashrc.zshrc),因此环境(包括 $PATH)与终端中的环境不同。可能的解决方案:

  • 解决方法 1:通过将所需变量移动到相应的 shell 配置文件配置
  • ,使登录 shell 中可用的变量
  • 解决方法 2:从终端 运行 IDE 使其继承终端环境

另见 IDEABKL-7589