Exhibit 23.1 CONSENT OF INDEPENDENT AUDITORS We consent to the reference to our firm under the caption "Experts" in the Registration Statement (Form S-3) and related Prospectus of NCI Building Systems, Inc. for the registration of 3,800,000 shares of its common stock and to the use of our report dated December 8, 1997 (except for Note 9, as to which the date is July 31, 1998), with respect to the consolidated financial statements of NCI Building Systems, Inc. for the year ended October 31, 1997, and of our report dated August 5, 1998, with respect to the consolidated financial statements of Amatek Holdings, Inc. for the year ended December 31, 1997, included in the Registration Statement on Form S-3. /s/ ERNST & YOUNG LLP ------------------------------- ERNST & YOUNG LLP Houston, Texas September 1, 1998