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

python - pip install -U PySide error -

arrays - C++ error: a brace-enclosed initializer is not allowed here before ‘{’ token -

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