Reputation: 1627
I have installed yeoman generator and it is shown in the package.json file , but I get the above error pointing on the Base.^extend in the following line when i run yo my-generator-name
module.exports = generators.Base.extend
complete file looks so:
'use strict';
var generators = require('yeoman-generator');
module.exports = generators.Base.extend({
method1: function(){
this.log('Hello World');
}
})
any help would be great!
Upvotes: 0
Views: 1209
Reputation: 14423
It looks like that the extend
method has been deprecated and removed by now. You'll have to use class syntax to extend the generator class.
Breaking changes
Generator.extend() is replaced in favor of
class extends Generator {}
const Generator = require('yeoman-generator');
module.exports = class extends Generator {
/* your code here*/
}
Upvotes: 4