简体   繁体   中英

Laravel Command outputs different version of node than command line

I upgraded my node to v10.16.0 on a server containing a running Laravel instance.

This is the output after upgrade:

$ node -v
v10.16.0

This is the ouptut from running the Laravel scheduled command manually and echo-ing the response:

$ php artisan custom:command
v10.16.0

This is the output when that command is run by Laravel on it's 5 minute schedule:

v6.14.3

Laravel command is as follows:

$process = new Process("node -v");
$process->run();

How is this possible? Surely Laravel just runs a command on the command line in the same way you'd use exec() and thus should be on the same version. Even php artisan seems to get the right version.

  1. Restart the server
  2. Make sure that you've removed the older version of node and you only have v10

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM