generator icon indicating copy to clipboard operation
generator copied to clipboard

yeoman init angular:directive foobar error

Open camerongreen opened this issue 14 years ago • 3 comments

Centos 6.2 Yeoman 0.9.4

In yeoman-test directory (from tutorial)

yeoman init angular:directive foobar Running "init:yeoman" (init) task This task will create one or more files in the current directory, based on the environment and the answers to a few questions. Note that answering "?" to any question will show question-specific help and answering "none" to most questions will leave its value blank.

"yeoman" template notes:

invoke angular:directive Unable to read "/usr/local/node-v0.8.14-linux-x64/lib/node_modules/yeoman/node_modules/yeoman-generators/lib/generators/angular/templates/directive.js.js" file (Error code: ENOENT). Use --force to continue.

Aborted due to warnings.

camerongreen avatar Nov 02 '12 01:11 camerongreen

To get it working I did this: 12c12 < this.sourceRoot(path.join(__dirname, '../templates')); --- > this.sourceRoot(path.join(__dirname, '../templates/javascript')); 20,21c20,21 < this.template('directive.js', 'app/scripts/directives/' + this.name); < this.template('spec/directive.js', 'test/spec/directives/' + this.name); --- > this.template('directive', 'app/scripts/directives/' + this.name); > this.template('spec/directive', 'test/spec/directives/' + this.name);

camerongreen avatar Nov 02 '12 01:11 camerongreen

This is working find in 0.9.5 (npm update -g yeoman).

//These two lines:
ScriptBase = require('../script-base.js'),
ScriptBase.apply(this, arguments);

//set sourceRoot to templates/javascript or templates/coffeescript
this.template('directive', 'app/scripts/directives/' + this.name);

jacobmumm avatar Nov 08 '12 21:11 jacobmumm

Thanks, updated and working

ceoaliongroo avatar Nov 09 '12 07:11 ceoaliongroo