All threads / ArgumentError: Malformed version number string Yarn v0.1.1 2011 Jesper Kjeldgaard

Ask A Question

Notifications

You’re not receiving notifications from this thread.

ArgumentError: Malformed version number string Yarn v0.1.1 2011 Jesper Kjeldgaard

Cloud asked in Ruby
I have webpacker gem and yarn gem.. and I'm stuck with this error: (help please :))
# console
$ bin/rails webpacker:install
rails aborted!
ArgumentError: Malformed version number string Yarn v0.1.1 2011 Jesper Kjeldgaard
/path/to/project/bin/rails:9:in `<top (required)>'
/path/to/project/bin/spring:15:in `<top (required)>'
bin/rails:3:in `load'
bin/rails:3:in `<main>'
Tasks: TOP => webpacker:install => webpacker:check_yarn
(See full trace by running task with --trace)

Lets deal with the first problem first, that version of Yarn is pretty old.  The current version is v1.7.0.
If you installed it with brew update it with: 
brew upgrade yarn

That will either work or give you another error message to look up.

Too late to answer now but if someone else might stumble upon this question in future, in my case, below steps solved the above-mentioned error:

curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
sudo apt update && sudo apt install yarn
rails webpacker:install

Hope this helps !!!

Join the discussion

Want to stay up-to-date with Ruby on Rails?

Join 45,516+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.

    logo Created with Sketch.

    Ruby on Rails tutorials, guides, and screencasts for web developers learning Ruby, Rails, Javascript, Turbolinks, Stimulus.js, Vue.js, and more. Icons by Icons8

    © 2021 GoRails, LLC. All rights reserved.