Commit 2d4fe72 1 parent f56c533 commit 2d4fe72 Copy full SHA for 2d4fe72
File tree 1 file changed +5
-1
lines changed
lib/commands/doctor/checks
1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -87,9 +87,13 @@ module.exports = [{
87
87
title : 'Checking MySQL is installed' ,
88
88
skip : ( ctx ) => ctx . local || ( ctx . argv && ctx . argv . db === 'sqlite3' ) ,
89
89
task : ( ctx ) => {
90
+ // On ubuntu, mysqld is in `/usr/sbin` but it's not automatically in the PATH of non-root users
91
+ // So, we modify the path env var to make things work
92
+ let options = os . platform ( ) === 'linux' ? { env : { PATH : `/usr/sbin:${ process . env . PATH } ` } } : { } ;
93
+
90
94
// Technically this doesn't work on windows, but there's
91
95
// not an easy way to do that anyways so ¯\_(ツ)_/¯
92
- return execa . shell ( 'which mysqld' ) . catch ( ( ) => {
96
+ return execa . shell ( 'which mysqld' , options ) . catch ( ( ) => {
93
97
ctx . ui . log (
94
98
chalk . yellow ( `Local MySQL install not found. You can ignore this if you are using a remote MySQL host.${ eol } ` ) +
95
99
chalk . yellow ( `Alternatively you could:${ eol } ` ) +
You can’t perform that action at this time.
0 commit comments