How to join these 2 nodes and close the path with a straight line? I tried selecting them, but when I press join nodes , it doesn't do anything.
Judging from your recent questions on this site you might want to learn how to use the boolean operators in Inkscape. Look at this youtube clip for the basics.
In this case you could create a rectangle and rotate and scale it so that it covers the gap you are trying to fill. Then select both the rectangle and your original path and select Path>Union to merge them into one path.
Only open nodes (nodes with at most one outgoing line) can be joined. In your case, the nodes are closed (they have two outgoing lines).
Even if you could connect the nodes (which would be odd, because they would have three outgoing lines afterwards) the result wouln't be what you want. Consider the difference between a path stroke and a filled path. You work with a filled path.