Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.2k views
in Technique[技术] by (71.8m points)

npm - 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.

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

Anyone know how to remedy this or what is actually going on? I'm not able to use git at all from phpstorm because of this.

question from:https://stackoverflow.com/questions/65904363/runtime-node-version-is-different-than-what-node-v-returns-husky-cant-run-gi

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

When being launched from desktop/System menu/Toolbox, WebStorm only sees environment variables configured in login shell, but not in interactive shell configuration files (like .bashrc or .zshrc), so the environment (including $PATH) is different from the one you have in terminal. Possible solutions:

  • Workaround 1: make required variables available in a login shell by moving them to the corresponding shell profile config
  • Workaround 2: run IDE from a terminal to make it inherit terminal environment

see also IDEABKL-7589


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share
...