php - Is it possible to check if npm is installed in the system using composer? -


i writing composer file. in file checking whether imagick , mysql installed or not. want make sure whether npm installed in system or not. possible? in advance.

you can use exec run npm -v , check exit code.

exec('npm -v', $foo, $exitcode);  if ($exitcode === 0) {   echo 'npm installed!'; } 

Comments

Popular posts from this blog

apache - setting document root in antoher partition on ubuntu -

cytoscape.js - How to add nodes to Dagre layout with Cytoscape -

Process 'command 'F:\android-sdk\build-tools\21.1.2\aapt.exe'' finished with non-zero exit value 1 -