49

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?

Aurora0001
  • 13,139
  • 5
  • 50
  • 53
Daniel W
  • 1,092
  • 1
  • 12
  • 25
  • yarn will be supported in **2016.3** -- https://youtrack.jetbrains.com/issue/WEB-23737#comment=27-1669437 . Also : https://youtrack.jetbrains.com/issue/WEB-23820 – LazyOne Oct 26 '16 at 09:02
  • Got it. Guess I'll just stick to terminal now then. Thanks! – Daniel W Oct 26 '16 at 09:22

1 Answers1

58

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

LazyOne
  • 158,824
  • 45
  • 388
  • 391
  • 2
    WebStorm 2016.3 is not supporting yarn installed by homebrew now. I commented in https://youtrack.jetbrains.com/issue/WEB-23737#comment=27-1669437&u=1477301084808&tab=Comments . Hope it will be fixed in the near future. – morphinewan Dec 01 '16 at 10:13
  • I don't know how to set yarn if it's installed globally on windows with exe method. When setting it to `C:\Program Files (x86)\Yarn` I got `Please specify npm/yarn package: cannot find "bin\npm-cli.js"`. Same with `C:\Program Files (x86)\Yarn\bin`. Going back to default `C:\Program Files\nodejs\node_modules\npm` – rofrol Dec 13 '16 at 15:26
  • @rofrol No idea -- PhpStorm 2016.3.1 picked it up automatically -- I just had to choose another entry in that dropdown box -- IDE found it automatically -- http://postimg.org/image/gk8nead6v/ – LazyOne Dec 13 '16 at 16:00
  • 1
    Yarn in installed globally on my machine, i also added yarn to WebStorm run configuration as *node interpreter:* C:\Program Files (x86)\Yarn\bin\yarn.cmd *node parameters:* start *working directory:* ... Usually i open CMD in working directory and run *yarn start*, when i do Run from WebStorm with the yarn config from above, it shows first couple lines exactly the same as in CMD: yarn start v0.23.3 $ yarn install && webpack-dev-server --config ./buildScripts/webpack.js --env.mode debug but after that it does not do anything.... (in CMD next line is: yarn install v0.23.3) – Sasha Bond Oct 03 '17 at 20:17