A modified Petviashvili method is proposed for the computation of steady solitary-wave solutions to a nonlinear dispersive wave equation in fluids. The main difference between the Petviashvili's original method and the proposed method lies in the choice of a stabilizing factor. Compared to the original Petviashvili method, the proposed method adopts much simpler stabilizing factors such as the maximum, the -norm, and the central value of the intermediate relevant terms during iteration in the wavenumber domain. The motivation for using these stabilizing factors derives from the power method in the classical matrix eigenvalue problem, where the same stabilizing factors are often adopted to find the dominant eigenvector. In a similar vein, the Fourier-transformed nonlinear wave equation with power-law nonlinearity can be interpreted as a nonlinear eigenvalue problem, where the associated matrix is unknown, and can be iteratively solved by the proposed method, in which the resultant solitary-wave solution corresponds to the inverse Fourier transform of the final dominant eigenvector. Based on the proposed method, steady 2-D and 3-D solitary waves are effectively obtained for several exemplary nonlinear dispersive wave equations with power-law nonlinearities.