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. included in the Registration Statement on Form S-3, and of our report dated August 5, 1998, with respect to the consolidated financial statements of Amatek Holdings, Inc. included in the Registration Statement on Form S-3. /s/ ERNST & YOUNG LLP ----------------------------- ERNST & YOUNG LLP Houston, Texas August 6, 1998