yeoman - 选择在 Yeoman 中生成命令的位置

标签 yeoman yeoman-generator spawn cd

我正在构建一个生成器,最后我需要在应用程序的某个目录中进行npm install,我尝试了以下操作:

this.spawnCommandSync('cd', [this.destinationRoot() + '/my/folder'])
this.spawnCommandSync('npm', ['install'])

但它不起作用。

并且 npm install 不能在不同的目录中调用,也不能在任何 yeoman install mixins 中调用。 .

最佳答案

关于yeoman - 选择在 Yeoman 中生成命令的位置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33160904/

相关文章:

Java Runtime.exec() 不支持 Linux 别名

c - popen2 : reading works, 写入不

php - 使用 PHP 和 Grunt 开发单页应用程序的工作流程

JHipster模块 Hook 错误

yeoman - 我应该如何移动或删除 Yeoman Generator 中的文件?

javascript - 在 yeoman 中导航文件夹结构

node.js - 如何在nodejs中列出子进程

AngularJS: Controller /服务应该是帕斯卡案例? (在 yeoman 中使用 Yo)

node.js - 无法让 Yeoman 正常工作

gruntjs - 从 yeoman/grunt 中删除组件/任务的正确方法?