Coder Social home page Coder Social logo

generator-kraken's Introduction

generator-kraken

Build Status
NPM version
Dependencies Status
DevDependencies Status

Generator for scaffolding out Kraken applications.

Getting Started

⚠️ Upgrading to 1.x?

Route registration has been enhanced with kraken 1.x. Please be aware that this changes where controllers are generated.

Already familiar with the generator? Skip right to the new stuff.

Installation

$ [sudo] npm install -g yo generator-kraken bower

Usage

$ yo kraken

Generators

$ yo kraken [myApp] Creates a new kraken application. Parameters:

--templateModule - (Optional) Set the template module
--cssModule - (Optional) Set the CSS module
--jsModule - (Optional) Set the JavaScript module

$ yo kraken:controller myController
Generates a new controller namespace called myController and it's dependencies.

$ yo kraken:model myModel
Generates a new model named myModel.

$ yo kraken:template myTemplate
Generates a new template named myTemplate and it's dependencies.

$ yo kraken:locale myFile [myCountry myLang] Generates a new content bundle named myFile.

Learning Your Way Around

Once installed, you can create a basic application by following the prompts.

$ yo kraken

     ,'""`.
    / _  _ \
    |(@)(@)|   Release the Kraken!
    )  __  (
   /,'))((`.\
  (( ((  )) ))
   `\ `)(' /'

[?] Application name: HelloWorld
...

To run your application, just go into the newly created directory and type npm start.

$ cd HelloWorld
$ npm start

> [email protected] start ~/HelloWorld
> node index.js

Listening on 8000

Project Structure

  • /config/ - Application and middleware configuration
  • /controllers/ - Application routes
  • /locales/ - Country/language specific content bundles
  • /models/ - Controller models
  • /public/ - Web resources that are publicly available
  • /public/templates/ - Server and browser-side templates
  • /tests/ - Unit and functional test cases
  • /index.js - Application entry point

Configuration

Application configuration can be found in /config/config.json.

Different environment configuration can be loaded by creating an alternate file with the environment, e.g. ./config/development.json. You can control which file is loaded by defining an environment variable, NODE_ENV, and setting its value to production or development.

Controllers

Route logic is moved into the /controllers/ directory.

For example, a route for your home page, would use a /controllers/index.js file such as:

'use strict';

var IndexModel = require('../models/index');

module.exports = function (router) {
    var model = new IndexModel();

    router.get('/', function (req, res) {
        res.render('index', model);
    });
};

This file would define the routes and the logic for the home page. The advantage of keeping routes and logic segregated in individual files starts to show as the application grows. If something fails, it's very easy to pinpoint where things went wrong.

When a new controller is created, the generator will also create a template, locale file, and model for you.

⚠️ New in kraken 1.x

Kraken 1.x now leverages express 4 and, most notably, passes a router into your controllers.

Additionally, routes are now—by default—automatically determined for you based on directory structure. For example, if we wanted to have a number of routes that start with /users, we could simply create a /controllers/users/index.js file with the following contents:

'use strict';

module.exports = function (router) {
    // note that we don't need to specify "/users"
    router.get('/', function (req, res) {
        res.send('You can find me at /users');
    });

    router.get('/new', function (req, res) {
        res.send('You can find me at /users/new');
    });
}

Calling yo kraken:controller users would be enough to generate the basis for that file. Want to register routes that begin with /users/all? yo kraken:controller users/all is the command you're looking for.

Route registration is highly customizable. If you're interested in trying a different behavior, be sure to check out the module that takes care of it in kraken: express-enrouten.

Models

Data models are separated from the controller logic resulting in cleaner, more organized code. Data models live in the /models/ folder.

'use strict';

module.exports = function IndexModel() {
    return {
        name: 'myApp'
    };
};

While not very complex, this model serves as a base to build upon.

Templates

Dust JavaScript templates are the default templating language.

Templates are loaded from the /public/templates/ directory. Since they exist in the public folder the application can render the same templates on the server side as well as the client side.

Localized Content

When using Dust for it's templating, the application is able to load localized templates. If we wanted to greet a user in their native language, we would simply add this context to the response before rendering the template:

function (req, res) {
	res.locals.context = { locality: 'es_ES' };

	res.render('index', {
	    name: 'Antonio Banderas'
	});
}

We would also change our template as follows, using a @pre content tag:

<h1>{@pre type="content" key="index.greeting"/}</h1>

This instructs the application to pick up the index.greeting string from the appropriate locale content bundle in the /locales/ directory, in this case /locales/ES/es/.

License

Apache 2.0

generator-kraken's People

Contributors

alexsantos avatar aravindsrivats avatar aredridel avatar bergquist avatar cewilliams avatar christophior avatar felquis avatar flsafe avatar foobarwidget avatar gabrielcsapo avatar grawk avatar jasisk avatar jeffharrell avatar kethinov avatar lensam69 avatar matiboy avatar mindpivot avatar mstuart avatar pvenkatakrishnan avatar rowno avatar shaunwarman avatar tlivings avatar totherik avatar xjamundx avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

generator-kraken's Issues

install generator-kraken Error

Please have a look.

npm -v
1.2.18
npm install -g generator-kraken
Error: No compatible version found: chalk@'^0.4.0'
npm ERR! Valid install targets:
npm ERR! ["0.1.0","0.1.1","0.2.0","0.2.1","0.3.0","0.4.0"]
npm ERR!     at installTargetsError (/Users/mani/nvm/v0.10.5/lib/node_modules/npm/lib/cache.js:685:10)
npm ERR!     at /Users/mani/nvm/v0.10.5/lib/node_modules/npm/lib/cache.js:607:10
npm ERR!     at saved (/Users/mani/nvm/v0.10.5/lib/node_modules/npm/node_modules/npm-registry-client/lib/get.js:138:7)
npm ERR!     at Object.oncomplete (fs.js:107:15)
npm ERR! If you need help, you may report this log at:
npm ERR!     <http://github.com/isaacs/npm/issues>
npm ERR! or email it to:
npm ERR!     <[email protected]>

less task not finding sources

When I run grunt build on a default generated project, the generated css does not get placed in .build/css Running in development mode, however does place a generated css in the .build directory. Am I missing something?

Contents of app.less:

@font-color: blue;
.head {
    color: @font-color;
}

generated less.js task:

'use strict';


module.exports = function less(grunt) {
    // Load task
    grunt.loadNpmTasks('grunt-contrib-less');

    // Options
    return {
        build: {
            options: {
                cleancss: false
            },
            build: {
                files: [{
                    expand: true,
                    cwd: 'public/css',
                    src: ['**/*.less'],
                    dest: '.build/css/',
                    ext: '.css'
                }]
            }
        }
    };
};

The following output is observed when running grunt -v less:build:

Running tasks: less:build

Running "less:build" (less) task
Verifying property less.build exists in config...OK
File: [no files]
Options: cleancss=false
>> Destination not written because no source files were provided.

Data Access/Persistence Layer

I used the generator this weekend to put together a basic site and the only pain point for me was setting up authentication via passport with a local strategy.

I think it mostly came down to having to setup my data access/persistence layer (BackboneORM, Bookshelf, or Mongoose) on my own and integrate it in. I know the project has no particular data access/persistence layer opinions right now, and I can understand why, but are there any plans to eventually pick something generic for people to use? I think this would make this framework a lot more productive for me.

Problem permission

On ubuntu 13.04

$: yo kraken

Result :
Error : EACCES, mkdir /home/myUserAccount/.npm/minimist/0.0.7
errno : 3
code : EACCES
path : /home/myUserAccount/.npm/minimist/0.0.7
parent : localizr

Please try running this command again as root/Administrator
(I changed the permission (chmod & chown), and I get hundred more permission problems with others node package)

So :

$: sudo yo kraken
Result :
Error : EACCES, permission denied '/home/myUserAccount/.config/configstore/update-notifier-generator-kraken.yml'
You don't have access to this file.
at Object.fs.openSync(evalmachine.:432:18)
at Object.fs.readFileSync(evalmachine.:289:15)
(lots of nodejs line)
at Environment.create(/usr/lib/node_modules/yo/node_modules/yeoman-generator/lib/env/index:246:15)

There is an permission issue in default implementation of the generator. The "Permission denied" ping-pong is problematic.

thanks,

xeonarno

TypeError: Cannot read property 'latest' of undefined (livereload install)

Hi guys!

I updated generator-kraken to version 1.0.0-beta this morning and tried to generate a new app with and it failed.

This is the partial output of the npm-debug.log :

...
2295 http 404 https://registry.npmjs.org/livereload
2296 silly registry.get cb [ 404,
2296 silly registry.get { date: 'Thu, 03 Apr 2014 08:51:13 GMT',
2296 silly registry.get server: 'CouchDB/1.5.0 (Erlang OTP/R14B04)',
2296 silly registry.get etag: '"3MPRX57CUHFGTBDX3Z9E5UI1R"',
2296 silly registry.get 'content-type': 'application/json',
2296 silly registry.get via: '1.1 varnish',
2296 silly registry.get 'cache-control': 'max-age=0',
2296 silly registry.get 'content-length': '744',
2296 silly registry.get 'accept-ranges': 'bytes',
2296 silly registry.get age: '0',
2296 silly registry.get 'x-served-by': 'cache-v37-ASH, cache-fra1229-FRA',
2296 silly registry.get 'x-cache': 'MISS, MISS',
2296 silly registry.get 'x-cache-hits': '0, 0',
2296 silly registry.get 'x-timer': 'S1396515073.548372269,VS0,VS47,VE142,VE188',
2296 silly registry.get vary: 'Accept',
2296 silly registry.get 'keep-alive': 'timeout=10, max=50',
2296 silly registry.get connection: 'Keep-Alive' } ]
2297 silly addNameRange number 2 { name: 'livereload',
2297 silly addNameRange range: '>=0.3.3-0 <0.4.0-0',
2297 silly addNameRange hasData: true }
2298 silly addNameRange versions [ 'livereload', [] ]
2299 error TypeError: Cannot read property 'latest' of undefined
2299 error at next (C:\Program Files\nodejs\node_modules\npm\lib\cache.js:744:35)
2299 error at C:\Program Files\nodejs\node_modules\npm\lib\cache.js:732:5
2299 error at saved (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-registry-client\lib\get.js:148:7)
2299 error at C:\Program Files\nodejs\node_modules\npm\node_modules\graceful-fs\polyfills.js:133:7
2299 error at Object.oncomplete (fs.js:107:15)
2300 error If you need help, you may report this entire log,
2300 error including the npm and node versions, at:
2300 error http://github.com/npm/npm/issues
2301 error System Windows_NT 6.1.7601
2302 error command "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "install"
2303 error cwd C:\DakarBio
2304 error node -v v0.10.26
2305 error npm -v 1.4.3
2306 error type non_object_property_load
2307 verbose exit [ 1, true ]

I tried to install "livereload" myself and i get the same error message from npm.

I think there is a problem with the definition of the version with this module. Indeed, if you take a look at https://www.npmjs.org/package/livereload you can see that.

At the same time there is what seems a substitute of this module here https://www.npmjs.org/package/livereload2.

It's very confusing...

Thanks

yo kraken:page myPage can't set language

Hi , thanks for your great work.

When I use this command to generate one page, it generates default US language file, but I don't use US language as default.

In fact, I don't need multi languages.

Could you please tell me how to disable multi language or create language file for each?

Deep-linked pages generator doesn't generate resulting paths properly

So I found myself creating an Administrative section for my site in Kraken and wanted to have both a directory structure and route reflecting:

https://**.com/admin/dashboard
https://**.com/admin/pages
etc...

However, when i type:

$ yo kraken:page admin/dashboard

the resulting controller doesn't know it's been created a directory further down the tree and the routes it's created in the file are missing the "/" in them. The files do get created in their proper locations, it's important to note.

The route that gets written to the file is "admindashboard". Same as anywhere else I typed "admin/dashboard" and the generator inserted it into the templates.

Hope this makes sense.

Add additional CLI args

  • Spec (module name or default: lib/spec.js)
  • Template module
  • CSS module
  • JS module
  • Task module

`grunt build` exiting with 'Task "false" not found.'

I generated a new Kraken project with yo kraken and selected "none" as the template library. Once the project was generated, I ran grunt build. It exited with:

Warning: Task "false" not found. Use --force to continue.

In tasks/i18n.js, Line 6 has:

grunt.registerTask('i18n', [ 'clean', 'localizr', 'false', 'clean:tmp' ]);

Removing the "false" fixes the warning.

index.dust created with 'None' template library

$ yo kraken
choose 'None' as template library

index.dust still gets created under public/templates directory. After starting up the app, access http://localhost:8000, the following error occurs:

Error: No default engine was specified and no extension was provided.
    at new View (/Users/sthiyarathod/kraken-html/node_modules/express/lib/view.js:41:42)
    at Function.app.render (/Users/sthiyarathod/kraken-html/node_modules/express/lib/application.js:501:12)
    at ServerResponse.res.render (/Users/sthiyarathod/kraken-html/node_modules/express/lib/response.js:782:7)
    at serverError (/Users/sthiyarathod/kraken-html/node_modules/kraken-js/middleware/500.js:30:17)
    at Layer.serverError [as handle] (eval at createToggleWrapper (/Users/sthiyarathod/kraken-html/node_modules/kraken-js/node_modules/meddleware/index.js:133:51), <anonymous>:1:77)
    at trim_prefix (/Users/sthiyarathod/kraken-html/node_modules/express/lib/router/index.js:252:17)
    at /Users/sthiyarathod/kraken-html/node_modules/express/lib/router/index.js:216:9
    at Function.proto.process_params (/Users/sthiyarathod/kraken-html/node_modules/express/lib/router/index.js:286:12)
    at next (/Users/sthiyarathod/kraken-html/node_modules/express/lib/router/index.js:207:19)
    at trim_prefix (/Users/sthiyarathod/kraken-html/node_modules/express/lib/router/index.js:256:11)

To fix it,

  1. I created index.html instead of index.dust in public/templates folder.
  2. Add following lines in index.js
    var express = require('express');
    app.use(express.static(__dirname + '/public/templates'));

I think, if we choose not to use Dust, the app should point to static file directory.

Generated app doesn't run on Heroku

When generating a new Kraken project, and attaching it to a Heroku app, the app runs fine in foreman, but throws the following error in Heroku logs when pushed to Heroku:

2013-12-02T03:11:46.816531+00:00 app[web.1]: [TypeError: Arguments to path.join must be strings]
2013-12-02T03:11:47.952702+00:00 heroku[web.1]: Process exited with status 0
2013-12-02T03:11:50.884712+00:00 heroku[web.1]: Starting process with command `bin/web`
2013-12-02T03:11:47.972187+00:00 heroku[web.1]: State changed from crashed to starting
2013-12-02T03:11:47.970913+00:00 heroku[web.1]: State changed from starting to crashed
2013-12-02T03:11:52.202737+00:00 app[web.1]: [TypeError: Arguments to path.join must be strings]
2013-12-02T03:10:03.293012+00:00 heroku[api]: Enable Logplex by [email protected]
2013-12-02T03:10:03.305616+00:00 heroku[api]: Release v2 created by [email protected]
2013-12-02T03:11:53.441791+00:00 heroku[web.1]: Process exited with status 0
2013-12-02T03:11:53.475140+00:00 heroku[web.1]: State changed from starting to crashed
2013-12-02T03:12:04.715764+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/favicon.ico host=APPNAME.herokuapp.com fwd="72.66.102.179" dyno= connect= service= status=503 bytes=
2013-12-02T03:12:04.635628+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/ host=APPNAME.herokuapp.com fwd="72.66.102.179" dyno= connect= service= status=503 bytes=

This occurs simply by using defaults and deploying. hopefully I'm just missing something and it isn't an actual issue.

Add express 4 support to 1.0.0

Off the top of my head we'd need to update the express and express-enrouten dependencies, change the middleware chain to pull applicable middleware from connect rather than express, and then update how the routes are generated to work with the new enrouten.

Issue happened when do `yo kraken`

I have Express 3.2.4 installed before so I don't want to install/upgrade to Express 4 for using Kraken.

Some key stuff version:
[email protected]
[email protected]
[email protected]
[email protected].

When I tried my first luck with kraken by using Yeoman command - yo kraken, after some interactive inputs, I eventually got error like below. It looks like it tried to install Express 4 globally.

npm WARN package.json [email protected] No repository field.
bower                           ENOENT No bower.json present
npm ERR! Error: EACCES, mkdir '/Users/qinguo/.npm/serve-static/1.3.2'
npm ERR!  { [Error: EACCES, mkdir '/Users/qinguo/.npm/serve-static/1.3.2']
npm ERR!   errno: 3,
npm ERR!   code: 'EACCES',
npm ERR!   path: '/Users/qinguo/.npm/serve-static/1.3.2',
npm ERR!   parent: 'express' }
npm ERR! 
npm ERR! Please try running this command again as root/Administrator.

npm ERR! System Darwin 13.3.0
npm ERR! command "node" "/usr/local/bin/npm" "install"
npm ERR! cwd /Users/qinguo/allcodes/play/ToDo-Kraken
npm ERR! node -v v0.10.29
npm ERR! npm -v 1.5.0-alpha-3
npm ERR! path /Users/qinguo/.npm/serve-static/1.3.2
npm ERR! code EACCES
npm ERR! errno 3
npm ERR! stack Error: EACCES, mkdir '/Users/qinguo/.npm/serve-static/1.3.2'
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /Users/qinguo/allcodes/play/ToDo-Kraken/npm-debug.log
npm ERR! not ok code 0

Notify users of any new versions of generator-kraken

Anytime a user uses yo kraken or any sub generator, we'll check for updates to generator-kraken. If a new version is out there, we will instruct them to npm update -g generator-kraken to pull in the latest version.

Following up with a PR shortly.

Controller should not use res.render if no view engine is specified.

Presently, a single controller template is used regardless of the view engine specified during yo kraken. This causes the app to throw because res.render has no engine to turn to.

Tasks (if no view engine selected):

  • Different controller template
  • Remove default generated .bowerrc
  • Remove error handling middleware

"yo kraken" failing to run

So trying to get Kraken installed, I run sudo npm install -g yo generator-kraken, and upon running yo kraken, I get the following:

$ yo kraken
Error kraken 

You don't seem to have a generator with the name kraken installed.
You can see available generators with npm search yeoman-generator and then install them with npm install [name].
To see the 0 registered generators run yo with the `--help` option.

Contents of yo --help:

$ yo --help
Usage: yo GENERATOR [args] [options]

General options:
  -h, --help     # Print generator's options and usage
  -f, --force    # Overwrite files that already exist

Please choose a generator below.

If it helps, I'm running Node v0.10.26.

Need to install update-notifier to make it work

I have just update the generator kraken and now I can't use it

$ yo kraken 

Error: Cannot find module 'update-notifier'
    at Function.Module._resolveFilename (module.js:338:15)
    at Function.Module._load (module.js:280:25)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at Object.<anonymous> (/usr/local/lib/node_modules/generator-kraken/lib/update.js:3:22)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:364:17)

doing npm install -g update-notifier fix the problem

Generated entry point is presenting an incomplete set of arguments

krakenjs/kraken-js#39

After reading through this issue, I realized that we are not properly exposing the created server back to the user.

This line will invoke the callback with (err, server).

However, we are not showing this here:

kraken.create(app).listen(function (err) {
    if (err) {
        console.error(err);
    }
});

The anonymous function should be function (err,server){ ... }. Otherwise developers won't know it's there without diving into the code.

Refactor code as a precursor to 1.0

This needs to include:

  • Removing hard coded file copy references
  • Add prompt support for multiple options for template/css/js
  • Update package.json to use carets
  • Clean up grunt tasks
  • Add more test cases

session store in kraken

Hi,
What is in your opinion the best way to use connect-redis to be session store in kraken (1.0)?
Any ideas on the subject?

Add config ability to override default partial include

When I run the yo kraken:controller <somename> the generator creates the necessary files but I notice it includes /layout/master.dust in templates. If it's not possible (I couldn't find it documented or example), it would be ideal that you could override this default in the config of kraken and generator would consider that for include. Ideally you could then also declare it as command line option to override that default.

The thinking is you may generate an app, build custom layouts, and later as your app expands want to use the generator to add more routes, views, etc. We still have to edit the templates so this is just convenience, but would be nice to have that option as engineers will commonly forget to change that which they didn't code.

Error when no module is selected for template

In the v1.0.0-rc.1 installed like this:

npm install -g [email protected]

I get the following:

$ yo kraken kraken

     ,'""`. 
hh  / _  _ \
    |(@)(@)|   Release the Kraken!
    )  __  (
   /,'))((`.\ 
  (( ((  )) ))
   `\ `)(' /'

Tell me a bit about your application:

[?] Description: none
[?] Author: none
[?] Template library? None
[?] CSS preprocessor library? None
[?] JavaScript library? None

/usr/local/lib/node_modules/generator-kraken/app/index.js:194
            throw new Error('Unable to resolve dependency: ' + key + ':' + val
                  ^
Error: Unable to resolve dependency: templateModule:None
    at Generator.addDependency [as _addDependency] (/usr/local/lib/node_modules/generator-kraken/app/index.js:194:19)
    at Generator.<anonymous> (/usr/local/lib/node_modules/generator-kraken/app/index.js:104:22)
    at PromptUI.onCompletion (/usr/local/lib/node_modules/yo/node_modules/yeoman-generator/node_modules/inquirer/lib/ui/prompt.js:51:10)
    at /usr/local/lib/node_modules/yo/node_modules/async/lib/async.js:232:13
    at /usr/local/lib/node_modules/yo/node_modules/async/lib/async.js:142:25
    at /usr/local/lib/node_modules/yo/node_modules/async/lib/async.js:229:17
    at PromptUI.<anonymous> (/usr/local/lib/node_modules/yo/node_modules/yeoman-generator/node_modules/inquirer/lib/ui/prompt.js:66:5)
    at Object.utils.runAsync (/usr/local/lib/node_modules/yo/node_modules/yeoman-generator/node_modules/inquirer/lib/utils/utils.js:44:5)
    at Prompt.filter (/usr/local/lib/node_modules/yo/node_modules/yeoman-generator/node_modules/inquirer/lib/prompts/base.js:149:9)
    at Prompt.done (/usr/local/lib/node_modules/yo/node_modules/yeoman-generator/node_modules/inquirer/lib/prompts/base.js:71:10)

I get the error for any option that none is selected

generator-kraken static module out of date?

I posted the same question on Stack Overflow, but thought maybe would be better to ask here.

Just getting started with KrakenJS. After running the generator and looking at the config.json I notice it has the "static" middleware defined as:

    "static": {
        "module": {
            "arguments": [ "path:./.build" ]
        }
    }

I have two issues/questions:

  1. After running grunt build I see the browserify output in the /.build folder, but when I navigate to /js/app.js it appears to load the file from the /public folder. Shouldn't it be from the /.build folder?
  2. With Express 4+ shouldn't this actually be serve-static?

I can't help but think I'm missing something.

Page generator broken with latest NPM update

I was notified an update existed and performed the npm update -g generator-kraken and it installed the latest version. I then visited a project folder and ran yo kraken:page listings and it failed. Prior to this update the generator worked.

Version 0.7.2

$ npm -v
1.3.21

$ sudo npm uninstall -g generator-kraken
Password:
unbuild [email protected]

Create new project to test bug

$ yo kraken

     ,'""`. 
hh  / _  _ \
    |(@)(@)|   Release the Kraken!
    )  __  (
   /,'))((`.\ 
  (( ((  )) ))
   `\ `)(' /'

Tell me a bit about your application:

[?] Name: Generator_Bug_Test
[?] Description: Testing issue with page generator
[?] Author: Me
[?] JavaScript module library? None

I cd to the directory and type the following:

Error output

$ yo kraken:page listings

     ,'""`. 
hh  / _  _ \
    |(@)(@)|   Release the Kraken!
    )  __  (
   /,'))((`.\ 
  (( ((  )) ))
   `\ `)(' /'

Tell me a bit about your application:

Error: Invalid sub-generator page

/usr/local/lib/node_modules/generator-kraken/util/validate.js:31
         console.error(this.help());
                            ^
TypeError: Object #<Object> has no method 'help'
    at Object.validate (/usr/local/lib/node_modules/generator-kraken/util/validate.js:31:29)
    at new Generator (/usr/local/lib/node_modules/generator-kraken/app/index.js:33:16)
    at Environment.create (/usr/local/lib/node_modules/yo/node_modules/yeoman-generator/lib/env/index.js:252:10)
    at Environment.run (/usr/local/lib/node_modules/yo/node_modules/yeoman-generator/lib/env/index.js:288:24)
    at init (/usr/local/lib/node_modules/yo/cli.js:95:7)
    at pre (/usr/local/lib/node_modules/yo/cli.js:113:3)
    at Object.<anonymous> (/usr/local/lib/node_modules/yo/cli.js:139:1)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)

Generator fails with execvp and ENOENT errors after upgrade on OSX

I performed sudo npm -g update generator-kraken the other day and since then either sub commands or the yo kraken had errors. I uninstalled, reinstalled, updated npm, updated homebrew, etc. Nothing seemed to work until I manually installed sudo npm install -g bower and then retried and everything worked.

Perhaps double-check dependencies in case some npm module is missing?

Error:

$ yo kraken

     ,'""`. 
hh  / _  _ \
    |(@)(@)|   Release the Kraken!
    )  __  (
   /,'))((`.\ 
  (( ((  )) ))
   `\ `)(' /'

Tell me a bit about your application:

[?] Name: fred
[?] Description: is dead
[?] Author: mike
[?] JavaScript module library? None
   create .bowerrc
   create .editorconfig
   create .jshintignore
   create .jshintrc
   create .nodemonignore
   create .npmignore
   create Gruntfile.js
   create README.md
   create config/app.json
   create config/middleware.json
   create index.js
   create locales/US/en/errors/404.properties
   create locales/US/en/errors/500.properties
   create locales/US/en/errors/503.properties
   create package.json
   create public/css/app.less
   create public/js/.jshintignore
   create public/js/.jshintrc
   create public/js/app.js
   create public/templates/errors/404.dust
   create public/templates/errors/500.dust
   create public/templates/errors/503.dust
   create public/templates/layouts/master.dust
   create tasks/clean.js
   create tasks/copyto.js
   create tasks/dustjs.js
   create tasks/i18n.js
   create tasks/jshint.js
   create tasks/less.js
   create tasks/makara.js
   create tasks/mochacli.js
   create tasks/requirejs.js
execvp(): No such file or directory

events.js:72
        throw er; // Unhandled 'error' event
              ^
Error: spawn ENOENT
    at errnoException (child_process.js:988:11)
    at Process.ChildProcess._handle.onexit (child_process.js:779:34)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.