[#1 Troubleshoot] WorkflowScript: 5: Tool type "nodejs" does not have an install of "NodeJS 18" configured
saya menemukan error ini Started by user widianto
Obtained Jenkinsfile from git http://172.16.10.128/widi/playwright.git
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
WorkflowScript: 5: Tool type "nodejs" does not have an install of "NodeJS 18" configured - did you mean "null"? @ line 5, column 12.
Β Β Β Β nodejs 'NodeJS 18'
tools {
nodejs 'NodeJS 18'
}
β Solusi
Kamu harus menambahkan NodeJS 18 ke konfigurasi Jenkins Tools, agar bisa dikenali oleh pipeline.
π§ Langkah-langkah Tambahkan NodeJS di Jenkins:
1. Masuk ke Jenkins β Manage Jenkins
2. Klik Global Tool Configuration
3. Scroll ke bagian NodeJS
Di situ akan ada form seperti ini:
Field | Isi |
---|---|
Name | NodeJS 18 β (harus sama persis dengan yang di Jenkinsfile ) |
Install automatically | β (Centang) |
Version | Pilih versi NodeJS 18.x (misal 18.17.1 atau terbaru) |
Contoh:
4. Klik tombol Save di paling bawah
β Setelah Itu:
Kamu bisa ulangi build pipeline kamu:
Build Now
Dan Jenkins sekarang akan:
-
Install NodeJS versi 18.x
-
Jalankan semua perintah
npm ci
,npx playwright install
, dll sesuai isiJenkinsfile
No Comments