Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Here may throw error self.env.emit is not a function #1182

Closed
mshima opened this issue Mar 4, 2020 · 1 comment · Fixed by #1183
Closed

Here may throw error self.env.emit is not a function #1182

mshima opened this issue Mar 4, 2020 · 1 comment · Fixed by #1183

Comments

@mshima
Copy link
Member

mshima commented Mar 4, 2020

Here may throw error self.env.emit is not a function

Originally posted by @ystarlongzi in https://github.com/_render_node/MDIzOlB1bGxSZXF1ZXN0UmV2aWV3VGhyZWFkMjM5NjI3MzQzOnYy/pull_request_review_threads/discussion

@mshima
Copy link
Member Author

mshima commented Mar 4, 2020

@ystarlongzi I just came across this issue again on Gitter.
Looks like there are modules that uses generator alone without a full environment.
This snippet allows the generator run standalone:

generator/lib/index.js

Lines 179 to 180 in 3d8374b

// Ensure the environment support features this yeoman-generator version require.
require('yeoman-environment').enforceUpdate(this.env);

It creates a working but not full featured environment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant