Yarn run configuration + maven frontend plugin

Hi!

I'm trying to create a run configuration that basically does 'yarn run watch' where watch is a script I defined in my package.json file.

I know that IntelliJ is able to run such a script using yarn by creating an NPM run configuration, by providing it the yarn package directory.

However: I'm trying to use a node / yarn installation that is automatically added to the project by the maven frontend plugin (https://github.com/eirslett/frontend-maven-plugin) since this is integrated into a standard Java maven build. In my run configuration, I can chose that particular downloaded node version with no problems.

Now here comes the kicker: the maven frontend plugin creates the yarn installation in a path like $PROJECT_ROOT/node/yarn/dist/bin/yarn.js. Problem: when I chose the /node/yarn folder in my run configuration, IntelliJ complains that it can't find bin/yarn.js. However, if I point it to /node/yarn/dist/ it complains that it can't find /bin/npm-cli.js, so it seems to get confused whether its looking for npm or yarn.

Is there any workaround for this?

Im trying to create a shared run configuration so that others can check it out and don't need to configure anything (as the node and yarn installation is done by maven through the frontend plugin).

0
4 comments

>when I chose the /node/yarn folder in my run configuration, IntelliJ complains that it can't find bin/yarn.js. However, if I point it to /node/yarn/dist/ it complains that it can't find /bin/npm-cli.js, so it seems to get confused whether its looking for npm or yarn.

 

Please can you provide screenshots of your run configurations and error messages?

0
Avatar
Permanently deleted user

I attached some screenshots. The first one is of the run configuration itself, the second one pops up when I run that configuration.

I made two alternatives, where I put in different paths. I also included a Screenshot of the directory structure (which was created by the frontend-maven-plugin).


 




0

recreated, logged as https://youtrack.jetbrains.com/issue/WEB-31586; please follow it for updates

For now I can suggest creating a symlink yarn/bin/yarn.js -> yarn/dist/bin/yarn.js in a postinstall script...

0
Avatar
Permanently deleted user

Thank you very much!

0

Please sign in to leave a comment.