RubyMine's run config results in error that “Yarn requires Node.js 4.0” on Ubuntu

╄→尐↘猪︶ㄣ 提交于 2020-01-11 13:43:27

问题


On my Elementary OS machine (an Ubuntu-based OS), after creating a new Ruby on Rails project with rails new yarntest and loading it in RubyMine, I could not launch it with RubyMine's "Development: yarntest" run configuration. The output was:

=> Booting Puma
=> Rails 6.0.1 application starting in development 
=> Run `rails server --help` for more startup options
Yarn requires Node.js 4.0 or higher to be installed.


========================================
  Your Yarn packages are out of date!
  Please run `yarn install --check-files` to update.
========================================


To disable this check, please change `check_yarn_integrity`
to `false` in your webpacker config file (config/webpacker.yml).

However, running rails server in the console worked.

I tried reinstalling Yarn, but it still did not work.

I could only disable the Yarn integrity check in the Ruby on Rails config as stated in the error message (deleting the yarn.lock also appeared to work, but is surely wrong). Similarly, I did not want to track down and remove the different Yarn version, as suggested on another question, since the issue was with RubyMine.


回答1:


I came across an answer on another question that mentioned this error message when running sudo yarn install (i. e. in sudo mode). I tried running sudo yarn install and could finally reproduce the error message outside of RubyMine's run config. Apparently, when running in sudo mode, the yarn binary was outdated.

The solution is therefore to point RubyMine to the correct yarn binary.

The easiest way to do that is to launch RubyMine from the terminal with rubymine, as pointed out by Olivia. See the related JetBrains ticket.



来源:https://stackoverflow.com/questions/59018952/rubymines-run-config-results-in-error-that-yarn-requires-node-js-4-0-on-ubunt

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!