generator-angular-fullstack icon indicating copy to clipboard operation
generator-angular-fullstack copied to clipboard

Error Path Must be String when generating a directive

Open sarvarbek opened this issue 9 years ago • 5 comments

When using the following command, angular-fullstack:directive and given the following example:

MacBook-Pro:order xxx$ yo angular-fullstack:directive ? What module name would you like to use? leftNav ? Where would you like to create this directive? client/components (Have tried with quotes as well) ? Does this directive need an external html file? Yes events.js:160 throw er; // Unhandled 'error' event ^

TypeError: Path must be a string. Received undefined at assertPath (path.js:7:11) at Object.join (path.js:1213:7) at /usr/local/lib/node_modules/generator-angular-fullstack/node_modules/generator-ng-component/generators/directive/index.js:68:37

Item Version
generator-angular-fullstack 4.1.0
generator-ng-component 1.0.2
Node 6.2.2
npm 3.9.5
Operating System OS X 10

sarvarbek avatar Oct 10 '16 17:10 sarvarbek

Which version of generator-angular-fullstack are you using? The "latest version" can change at any time. Also, do you know which version of generator-ng-component is installed under it?

Awk34 avatar Oct 10 '16 18:10 Awk34

@Awk34 I have updated the post with the version numbers.

sarvarbek avatar Oct 10 '16 19:10 sarvarbek

When calling the generator you should specify the name of your directive as an argument:

MacBook-Pro:order xxx$ yo angular-fullstack:directive leftNav

dwhaywood avatar Oct 16 '16 03:10 dwhaywood

@dwhaywood answer is correct.

aniknafs avatar Oct 25 '16 18:10 aniknafs

Hm... Maybe more intuitive behavior would be to throw this error before cli questions are asked? Otherwise, user is inclined to think that they entered in bunked up parameters rather than notice that they should've added a cli arg.

pixelpax avatar Sep 04 '17 20:09 pixelpax