Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create run configuration with Yarn instead of npm in WebStorm 2016.2.3

I used to work with npm via WebStorm. I usually just add a npm based run configuration in the right corner, like what described in here.

I recently tried Yarn and I'm trying to do similar thing like with npm, however I can't find the options. Is there any way to do this? Or I just need to wait for updates from JetBrains?

like image 857
Daniel W Avatar asked Oct 26 '16 08:10

Daniel W


People also ask

Can Yarn work without npm?

As I noted above, npm comes preinstalled with Node, so there's no need to install npm manually. In this case, berry is the version we want to set. With Yarn we can use a different version for each project. To do the same with npm, you'll need to have nvm (Node Version Manager) installed.


1 Answers

yarn will be supported in 2016.3

As stated in https://youtrack.jetbrains.com/issue/WEB-23737#comment=27-1669437

In WebStorm 2016.3 it will be possible to select yarn package instead of npm:

  • go to Settings | Languages & Frameworks | Node.js and NPM
  • click ellipsis button next to Node.js interpreter to open "Node.js interpreters" dialog

Also, installed yarn packages will be available in drop-down list for your convenience.

Once yarn package set, all npm-related actions will use the specified yarn package.

enter image description here

Also check the WEB-23820 ticket for "yarn tasks" support (side panel similar to NPM tasks one where you can see the tasks and execute them).


UPDATE (2016-11-15)
WebStorm 2016.3 was released yesterday. Both aforementioned tickets were implemented.


UPDATE (2016-12-13)
On Windows, if you install Yarn via .msi installer, the path would be C:\Program Files (x86)\Yarn -- IDE (PhpStorm 2016.3.1 in this case) detected it automatically.

enter image description here

like image 191
LazyOne Avatar answered Oct 13 '22 16:10

LazyOne