准备 Yeoman 1.0 ->this.installDependencies 不再起作用 [英] Preparing for Yeoman 1.0 -> this.installDependencies not working anymore

查看:38
本文介绍了准备 Yeoman 1.0 ->this.installDependencies 不再起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在将 JHipster 迁移到 Yeoman 0.20.1,以便为 Yeoman 做准备1.0.

I am working on migrating JHipster to Yeoman 0.20.1, in order to prepare for Yeoman 1.0.

在流程结束时,我们通常会:

At the end of our process, we normally:

  • 运行 npm installbower install
  • 使用回调函数来运行一些 Grunt 或 Gulp.js 任务,通常是 gruntwiredep

这一直有效,这是当前运行安装过程的代码.

自从我迁移到 Yeoman 0.20.1 后,我们仍然有:

Since I migrated to Yeoman 0.20.1, we still have:

  • 正在调用的 installDependencies 函数
  • 它甚至打印出消息我已经完成了.运行 npm install &bower install 为您安装所需的依赖项.如果失败,请尝试自己运行该命令.

但实际上没有安装发生!NPM 和 Bower 不安装任何东西,也不会调用我们的 Grunt 任务.请注意,如果我手动调用它们,它们可以正常工作.

But in fact no installation happens! NPM and Bower do not install anything, and our Grunt task is not called. Note that if I call them manually, they work correctly.

如果尝试调试它,它看起来像 未调用此方法.

If tried to debug this, and it looks like this method is not being called.

有人能帮我解决这个问题吗?

Can anybody help me on this issue?

推荐答案

我觉得运行循环可能会在 end 事件触发后完成.installDependencies 安排安装方法在 install 优先级期间运行.如果运行循环完成,它们将不会运行.

I feel like the run loop might be done after the end event is triggered. installDependencies schedule install methods to be runned during the install priority. If the run loop is done, they won't run.

您应该能够随时调用 installDependencies 而不必担心 end 事件回调.如果您想模仿当前的行为,请在名为 end 的方法中调用 installDependencies.

You should be able to just call installDependencies at any time and not worry about the end event callback. If you want to imitate the behavior you currently have, then call installDependencies inside a method called end.

作为 installDependencies API 的旁注,您不再需要手动指定 skipInstall(现在是自动的).

As a side note on the installDependencies API, you don't need to manually specify skipInstall anymore (that's now automatic).

这篇关于准备 Yeoman 1.0 ->this.installDependencies 不再起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆