~/ tanmen

~/posts / jetbrains-yarn

Making yarn usable in WebStorm under nodenv

To everyone who loves JetBrains:

I am one of you.

Demand for JS has been growing lately and I use WebStorm all the time, but under nodenv, none of the node-related commands would run from WebStorm.

The cause is on the WebStorm side: it cannot find the yarn or npm that live inside nodenv.

jetbrains-npm

For npm users there is a library called jetbrains-npm.

It makes WebStorm recognise npm.

With npm itself there is no problem, but it never runs installs and the like through yarn.

So it will not use your yarn.lock, and an install ends up creating a package-lock.json.

jetbrains-yarn

To get around all of that, I wrote a library called jetbrains-yarn.

The contents are almost identical to jetbrains-npm.

The difference is that the shims and commands point at yarn instead.

If you are stuck on this, give jetbrains-yarn a try.