angular-fullstack / generator-angular-fullstack

Yeoman generator for an Angular app with an Express server
https://awk34.gitbook.io/generator-angular-fullstack
6.12k stars 1.24k forks source link

Issue with yo angular:route #1301

Closed MarkPieszak closed 9 years ago

MarkPieszak commented 9 years ago

When trying to create a new route it's breaking in the generator, it seems like it's looking for the wrong location of app.js. (This is my guess)

It looks like it's pointing to /app/scripts/app.js when the file is in client/app.js

c:\NodeApps\MyApp>yo angular:route team
fs.js:565
fs.write = function(fd, buffer, offset, length, position, callback) {
                                                 ^
Error: ENOENT, no such file or directory 'c:\NodeApps\MyApp\app\scripts\ap
p.js'
    at Error (native)
    at Object.fs.openSync (fs.js:500:18)
    at Object.fs.readFileSync (fs.js:352:15)
    at new Generator (C:\Users\mark.name\AppData\Roaming\npm\node_modules\gen
erator-angular\route\index.js:18:29)
    at Environment.instantiate (C:\Users\mark.name\AppData\Roaming\npm\node_m
odules\yo\node_modules\yeoman-environment\lib\environment.js:297:10)
    at Environment.create (C:\Users\mark.name\AppData\Roaming\npm\node_module
s\yo\node_modules\yeoman-environment\lib\environment.js:274:15)
    at Environment.run (C:\Users\mark.name\AppData\Roaming\npm\node_modules\y
o\node_modules\yeoman-environment\lib\environment.js:333:24)
    at C:\Users\mark.name\AppData\Roaming\npm\node_modules\yo\lib\cli.js:97:9

    at Environment.resolver.lookup (C:\Users\mark.name\AppData\Roaming\npm\no
de_modules\yo\node_modules\yeoman-environment\lib\resolver.js:50:12)
    at init (C:\Users\mark.name\AppData\Roaming\npm\node_modules\yo\lib\cli.j
s:71:7)

Here is my .yo.rc.json file: You can see the generator-ng-component section is there and it's all pointing to /client/app.

Any ideas?

{
    "generator-angular-fullstack" : {

        "endpointDirectory" : "server/api/",
        "insertRoutes" : true,
        "registerRoutesFile" : "server/routes.js",
        "routesNeedle" : "// Insert routes below",
        "routesBase" : "/api/",
        "pluralizeRoutes" : true,
        "insertSockets" : true,
        "registerSocketsFile" : "server/config/socketio.js",
        "socketsNeedle" : "// Insert sockets below",
        "insertModels" : true,
        "registerModelsFile" : "server/sqldb/index.js",
        "modelsNeedle" : "// Insert models below",
        "filters" : {
            "js" : true,
            "html" : true,
            "sass" : true,
            "uirouter" : true,
            "bootstrap" : true,
            "uibootstrap" : true,
            "socketio" : true,
            "auth" : true,
            "models" : true,
            "mongooseModels" : true,
            "mongoose" : true,
            "oauth" : true,
            "googleAuth" : true,
            "facebookAuth" : true,
            "twitterAuth" : true,
            "grunt" : true,
            "jasmine" : true,
            "mocha" : false,
            "should" : false,
            "expect" : false
        }
    },
    "generator-ng-component" : {
        "routeDirectory" : "client/app/",
        "directiveDirectory" : "client/app/",
        "filterDirectory" : "client/app/",
        "serviceDirectory" : "client/app/",
        "basePath" : "client", 
        "moduleName" : "",
        "filters" : [
            "uirouter",
            "jasmine"
        ],
        "extensions" : [
            "js",
            "html",
            "scss"
        ],
        "directiveSimpleTemplates" : "",
        "directiveComplexTemplates" : "",
        "filterTemplates" : "",
        "serviceTemplates" : "",
        "factoryTemplates" : "",
        "controllerTemplates" : "",
        "decoratorTemplates" : "",
        "providerTemplates" : "",
        "routeTemplates" : ""
    }
}
Awk34 commented 9 years ago

If you want to use commands from our generator, you'll have to use yo angular-fullstack. yo angular is for generator-angular.