Error Path Must be String when generating a directive
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 |
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 I have updated the post with the version numbers.
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 answer is correct.
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.