The Peng-Robinson equation of state (PR-EOS) (Robinson and Peng 1978) with capillary effect has been used extensively to describe the phase behavior of hydrocarbons under nanoconfinement in shale reservoirs. In nanopores, surface adsorption may be significant, and molecular distribution is heterogeneous. Although the PR-EOS cannot consider these effects, statistical thermodynamic approaches such as density-functional theory (DFT) can explicitly consider the intermolecular and fluid/surface interactions. In this work, we compare the phase behavior of pure hydrocarbons and mixtures in nanopores from the PR-EOS with capillary effect and engineering DFT. We apply the Young-Laplace (YL) equation, assuming zero contact angle to calculate the capillary pressure in the PR-EOS with capillary effect. On the other hand, we extend the PR-EOS to inhomogeneous conditions with weighted-density approximation (WDA) in engineering DFT. For pure components, both approaches predict that the dewpoint temperature increases in hydrocarbon-wet nanopores. Although engineering DFT predicts that the confined dewpoint temperature approaches bulk saturation point when pore size approaches 30 nm, the saturation point obtained from the PR-EOS with capillary effect approaches bulk only when the pore size is as large as 1000 nm. With engineering DFT, the critical points in nanopores deviate from those in bulk, but no change is observed from the PR-EOS with capillary-effect model. The difference on the dewpoint temperature between the PR-EOS with capillary effect and engineering DFT decreases as the system pressure approaches the critical pressure. At low-pressure conditions, the PR-EOS with capillary-effect model becomes unreliable. For binary mixtures, both approaches predict that the lower dewpoint decreases and the upper dewpoint increases. More interestingly, phase transition can still occur when the system temperature is higher than the bulk cricondentherm point. Engineering DFT predicts that the confined lower dewpoint approaches bulk when pore size approaches 20 nm, whereas the dewpoint obtained from the PR-EOS with capillary effect approaches bulk only when the pore size is as large as 100 nm. This work illustrates that assuming homogeneous distributions in nanopores may not be appropriate to predict the phase behavior of hydrocarbons under nanoconfinement. [ABSTRACT FROM AUTHOR]