Skip to content

Commit f3a87cf

Browse files
Merge pull request #239 from Sebastian-Webster/visual-cpp-runtime
Throw informative error message when Visual C++ Redistributable is not installed on Windows
2 parents 994436b + 168c5db commit f3a87cf

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/libraries/Executor.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,14 @@ class Executor {
194194
}
195195

196196
if (code) {
197-
const errorMessage = `The database exited early with code ${code}. The error log was:\n${errorLog}\nThe error string was: "${errorString}".`
197+
let errorMessage: string = ''
198+
199+
if (os.platform() === 'win32' && code === 3221225781) {
200+
errorMessage = `The MySQL database exited early with code 3221225781. A possible cause is that the Microsoft Visual C++ Redistributable Package is not installed. Please refer to the following link for this package's requirements on your system - this may help solve this error: https://github.com/Sebastian-Webster/mysql-memory-server-nodejs/blob/v1.12.0/docs/SUPPORTED_MYSQL_DOWNLOADS.md#required-dependencies. If you are sure you have this installed, check the following for more details: The error log was:\n${errorLog}\nThe error string was: "${errorString}".`
201+
} else {
202+
errorMessage = `The database exited early with code ${code}. The error log was:\n${errorLog}\nThe error string was: "${errorString}".`
203+
}
204+
198205
this.logger.error(errorMessage)
199206
return reject(errorMessage)
200207
}

0 commit comments

Comments
 (0)