标签: javascript node.js npm
如何从js文件运行npm funct
答案 0 :(得分:1)
是的,您可以这样做,下面是代码:
var execSync = require('child_process').execSync; var list = execSync('yarn list', { encoding: 'utf-8' }); console.log(list);