Craft Commerce: Sort Products By Price
Close!  This should do it:

{% set products = craft.commerce.products({
    relatedTo: (category), 
    order: 'defaultPrice',
}) %}


With the quotes it's a string.  Without the quotes, Twig is expecting a variable you've defined called defaultPrice that doesn't exist.