Search code examples
node.jsintellij-ideaubuntu-18.04yarnpkgnvm

IntelliJ Ultimate Yarn requires nodejs 4 or higher


I recenty changed my nodejs version isntalled using nvm (I always used nvm, it was not a new install replacing native node). Yarn is up-to-date and natively install to

But now, when i try to commit (or anything else which use node in intellij like "run"), i get this kind of error

16:40   Commit failed with error
        0 file committed, 1 file failed to commit: feat(acl): fsdfsd
        Yarn requires Node.js 4.0 or higher to be installed.

It's like intellij or yarn didn't recognize anymore nodejs...

  • yarn 1.22.4
  • npm 6.14.6
  • node 12.18.3
  • nvm 0.35.3
  • intellij ultimate 2020.2
  • Ubuntu 18.04

Any idea what's happening ? Thanks in advance !


Solution

  • When being launched from desktop/System menu/Toolbox, IDEA only sees environment variables configured in login shell, but not in interactive shell configuration files (like .bashrc or .zshrc). 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 https://youtrack.jetbrains.com/issue/IDEABKL-7589