-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Check node and yarn #222
Check node and yarn #222
Conversation
I don't think we need to be chatty on the happy path. Is this the first time we're relying on a |
@matthewd Right, yeah a bit chatty 😄 Yeah, I think so. We have a yarn task in Rails 5.1 - https://github.com/rails/rails/blob/8e9e94391902b854662ba5eb06cc006cc4e85212/railties/lib/rails/generators/rails/app/templates/bin/yarn, but no |
lib/tasks/webpacker/check_node.rake
Outdated
node_version = `node -v` | ||
|
||
unless $?.success? | ||
puts "Node.js not installed" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this PR @gauravtiwari .
My suggestion. Use Node since all instructions mention Node instead of Node.js for consistency
puts "Node is not installed"
puts "Please install node at https://nodejs.org/en/download/ and run bundle exec rails webpacker:install"
exit!
lib/tasks/webpacker/check_node.rake
Outdated
end | ||
|
||
if node_version.tr("v", "").to_f < 6.4 | ||
puts "Webpacker require node >= 6.4 and you are using #{node_version}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Requires with a s
Node with a N
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My suggestion:
puts "Webpacker requires Node 6.4.0+ and you are using #{node_version}"
puts "Please upgrade Node at https://nodejs.org/en/download/ and run bundle exec rails webpacker:install"
exit!
lib/tasks/webpacker/check_node.rake
Outdated
exit! | ||
end | ||
|
||
puts "You are using node #{node_version}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Node with a N, please
Verify node and yarn before running installer Take 2 Fix case Use a new puts Remove .
👍 thanks @gauravtiwari ! I thought that the installation was successful, but turns out I didn't have Yarn yet:
|
Related to #217
@dhh Is this good enough?