DEV Community

alphokung
alphokung

Posted on

แก้ปัญหา Build NUXT 2.15.x บน node:lts ด้วย docker ไม่ได้

ช่วงนี้ได้เข้ามาช่วยทีมย้ายระบบที่เขียนด้วย Nuxt 2.15 แล้วเจอว่ามี bug บางอย่างที่ต้องทำการแก้ แต่พอแก้เสร็จดันเจอว่ามี error ที่ไม่เคยเจอเกิดขึ้น

Image description

หลังจากลองหาข้อมูลเลยถึงบางอ้อว่า ตอนนี้ Node17+ มันมีการปรับ Hash algorithm เลยทำให้ไม่สามารถรันได้ จำเป็นจะต้องเพิ่ม NODE_OPTIONS=--openssl-legacy-providerเข้าไปก่อนสั่ง yarn build

สรุปคือเติมประมาณนี้ใน Dockerfile ก็เรียบร้อยแล้ว

ENV NODE_OPTIONS=--openssl-legacy-provider
RUN yarn build
Enter fullscreen mode Exit fullscreen mode

Happy coding ครับ

Top comments (0)

Image of Docusign

🛠️ Bring your solution into Docusign. Reach over 1.6M customers.

Docusign is now extensible. Overcome challenges with disconnected products and inaccessible data by bringing your solutions into Docusign and publishing to 1.6M customers in the App Center.

Learn more