Skip to content

Fails on start - major updates/overhaul needed... #5

@kristianmandrup

Description

@kristianmandrup
kmandrup:private $ yo sails

/usr/local/lib/node_modules/generator-sails/app/index.js:44
--------.' + '\n   `---------´  |    ' + 'Welcome to Yeoman,'.yellow.bold + '
                                                                    ^
TypeError: Cannot read property 'bold' of undefined
    at Appgenerator.askFor (/usr/local/lib/node_modules/generator-sails/app/index.js:44:178)

Fix was to add the following to `app/index.js``

var colors = require('colors');

and install colors node package

$ npm install colors -g
npm http GET https://registry.npmjs.org/colors
npm http 304 https://registry.npmjs.org/colors
colors@0.6.2 /usr/local/lib/node_modules/colors

Now I get a new error:

Would you like to include Twitter Bootstrap for Sass? Y
Would you like to include RequireJS (for AMD support)? Y

/Users/kmandrup/private/yeoman-genrators/generator-sails/app/index.js:87
        this.compassBootstrap = props.compassBootstrap;
                                     ^
TypeError: Cannot read property 'compassBootstrap' of null
    at Appgenerator.<anonymous> (/Users/kmandrup/private/yeoman-genrators/generator-sails/app/index.js:87:38)

Fix is to update dependencies

// package.json

  "dependencies": {
    "yeoman-generator": "~0.13.4",
    "cheerio": "~0.12.3"
  },
  "peerDependencies": {
    "generator-mocha": "~0.1.1"
  },
  "devDependencies": {
    "mocha": "~1.13.0"
  },
  "engines": {
    "node": ">=0.10.0"
  },

npm update

Also had to update the _packages.json template file to reflect latest project versions ;)

{
  "name": "<%= _.slugify(appname) %>",
  "private": true,
  "version": "0.0.0",
  "description": "a Sails application",  
  "dependencies": {
    "sails": "~0.9.7",
    "grunt": "~0.4.1",
    "sails-disk": "~0.9.0",
    "ejs": "~0.8.4",
    "optimist": "~0.3.4"
  },
  "devDependencies": {
    "grunt": "~0.4.1",
    "grunt-sails": "git+https://colinwren@github.com/colinwren/grunt-sails.git",
    "grunt-contrib-copy": "~0.4.1",
    "grunt-contrib-concat": "~0.1.3",
    "grunt-contrib-coffee": "~0.7.0",
    "grunt-contrib-uglify": "~0.2.4",
    "grunt-contrib-compass": "~0.6.0",
    "grunt-contrib-jshint": "~0.6.4",
    "grunt-contrib-cssmin": "~0.6.2",
    "grunt-contrib-connect": "~0.5.0",
    "grunt-contrib-clean": "~0.4.1",
    "grunt-contrib-htmlmin": "~0.1.3",
    "grunt-contrib-imagemin": "~0.3.0",
    "grunt-contrib-livereload": "~0.1.2",
    "grunt-bower-requirejs": "~0.4.1",
    "grunt-rev": "~0.1.0",
    "grunt-usemin": "~2.0.0",
    "grunt-regarde": "~0.1.1",<% if (includeRequireJS) { %>
    "grunt-contrib-requirejs": "~0.4.1",<% } %>
    "grunt-mocha": "~0.4.1",
    "grunt-open": "~0.2.2",
    "grunt-svgmin": "~0.2.0",
    "grunt-concurrent": "~0.4.1",
    "matchdep": "~0.3.0"
  },
  "scripts": {
      "start": "node app.js",
      "debug": "node debug app.js"
  },
  "main": "app.js",
  "engines": {
    "node": ">=0.10.0"
  }
}

Now it finally gets through, but still some warnings about unmet dependencies... maybe I just need to run it again from a clean start?

npm WARN prefer global bower@0.10.0 should be installed with -g
npm WARN unmet dependency /Users/kmandrup/dev/generator-sails-playground/node_modules/sails requires grunt-contrib-clean@'0.4.1' but will load
npm WARN unmet dependency /Users/kmandrup/dev/generator-sails-playground/node_modules/grunt-contrib-clean,
npm WARN unmet dependency which is version 0.5.0
grunt-concurrent@0.4.1 node_modules/grunt-concurrent
└── lpad@0.1.0

grunt-contrib-compass@0.6.0 node_modules/grunt-contrib-compass
├── dargs@0.1.0
├── tmp@0.0.21
└── async@0.2.9

grunt-contrib-clean@0.5.0 node_modules/grunt-contrib-clean
└── rimraf@2.2.2 (graceful-fs@2.0.1)

grunt-usemin@2.0.0 node_modules/grunt-usemin
├── debug@0.7.2
└── lodash@1.0.1

grunt-contrib-jshint@0.6.4 node_modules/grunt-contrib-jshint
└── jshint@2.1.11 (console-browserify@0.1.6, underscore@1.4.4, minimatch@0.2.12, cli@0.4.5, shelljs@0.1.4)

grunt-contrib-connect@0.5.0 node_modules/grunt-contrib-connect
├── connect-livereload@0.2.0
├── open@0.0.4
└── connect@2.7.11 (fresh@0.1.0, pause@0.0.1, cookie-signature@1.0.1, qs@0.6.5, bytes@0.2.0, buffer-crc32@0.2.1, cookie@0.0.5, debug@0.7.2, send@0.1.1, formidable@1.0.14)

grunt-contrib-requirejs@0.4.1 node_modules/grunt-contrib-requirejs
└── requirejs@2.1.9

matchdep@0.3.0 node_modules/matchdep
├── stack-trace@0.0.7
├── resolve@0.5.1
├── findup-sync@0.1.2 (glob@3.1.21, lodash@1.0.1)
└── globule@0.1.0 (minimatch@0.2.12, glob@3.1.21, lodash@1.0.1)

grunt-svgmin@0.2.0 node_modules/grunt-svgmin
├── filesize@1.8.0
└── svgo@0.3.7 (colors@0.6.2, whet.extend@0.9.9, coa@0.3.9, sax@0.5.5, js-yaml@2.1.3)

grunt-mocha@0.4.1 node_modules/grunt-mocha
├── mocha@1.12.1 (growl@1.7.0, debug@0.7.2, commander@0.6.1, diff@1.0.2, glob@3.2.1, mkdirp@0.3.5, jade@0.26.3)
└── grunt-lib-phantomjs@0.3.1 (eventemitter2@0.4.13, semver@1.0.14, temporary@0.0.7, phantomjs@1.9.2-2)

grunt-contrib-imagemin@0.3.0 node_modules/grunt-contrib-imagemin
├── filesize@1.10.0
├── chalk@0.2.1 (ansi-styles@0.2.0, has-color@0.1.1)
├── jpegtran-bin@0.2.0 (which@1.0.5, mkdirp@0.3.5, tar@0.1.18, request@2.26.0, mocha@1.12.1)
├── optipng-bin@0.3.1 (bin-wrapper@0.1.6)
├── gifsicle@0.1.4 (bin-wrapper@0.1.6)
└── pngquant-bin@0.1.5 (bin-wrapper@0.1.6)

Ah, setting "grunt-contrib-clean": "~0.4.1", should do the trick to remove this warning ;)
Cheers!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions