gpt4 book ai didi

yeoman - 为 Yeoman 1.0 做准备 -> this.installDependencies 不再工作

转载 作者:行者123 更新时间:2023-12-01 15:49:42 25 4
gpt4 key购买 nike

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

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

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

这一直有效,而且 here is the current code运行安装过程。

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

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

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

如果尝试调试它,它看起来像 this method没有被调用。

谁能帮我解决这个问题?

最佳答案

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

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


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

关于yeoman - 为 Yeoman 1.0 做准备 -> this.installDependencies 不再工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30592237/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com