You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Placing the generator index.js file inside generators/app instead of the root of the generator project worked for me.
// ./generator/app/index.jsvarGenerator=require('yeoman-generator');// Try this sample generatormodule.exports=classextendsGenerator{constructor(args,opts){// Calling the super constructor is important so our generator is correctly set upsuper(args,opts);}method1(){this.fs.write(this.destinationPath('index.js'),'const foo = 1;');}};
Now, you might still have an error with yo doctor; however, you'll have a working generator.
A better approach would be is to use Yeoman's generator-generator as a starter kit for your generator and then build on top of that.
I am unable to run yo, so I ran "yo doctor" and I am getting the error message below.
Yeoman Doctor
Running sanity checks on your system
√ No .bowerrc file in home directory
√ Global configuration file is valid
× NODE_PATH matches the npm root
Unable to find the npm root, something went wrong.
Try to execute npm -g root --silent on your command-line
√ No .yo-rc.json file in home directory
√ Node.js version
√ npm version
√ yo version
Found potential issues on your machine :(
NOTES:
The text was updated successfully, but these errors were encountered: