Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

sails 0.9.8 not work, when created controller and lift it

sails 0.9.8 not work, when created controller and lift it

Problem

I have a problem with sails 0.9.8. I already installed sails on my mac and also Lift, it work well, but when start generate controller and model then start lift command again it show some error like:

$sails lift

/usr/local/lib/node_modules/sails/node_modules/waterline/lib/waterline/core/index.js:68
    var schemaAttributes = this.waterline.schema[this.identity].attributes;
                                                ^
TypeError: Cannot read property 'user' of undefined
    at _.extend._initialize (/usr/local/lib/node_modules/sails/node_modules/waterline/lib/waterline/core/index.js:68:49)
    at module.exports (/usr/local/lib/node_modules/sails/node_modules/waterline/lib/waterline/core/index.js:45:8)
    at module.exports (/usr/local/lib/node_modules/sails/node_modules/waterline/lib/waterline/collection/index.js:57:8)
    at new child (/usr/local/lib/node_modules/sails/node_modules/waterline/lib/waterline/utils/extend.js:17:39)
    at instantiateCollection (/usr/local/lib/node_modules/sails/lib/hooks/orm/index.js:174:25)
    at /usr/local/lib/node_modules/sails/node_modules/async/lib/async.js:108:13
    at Array.forEach (native)
    at _each (/usr/local/lib/node_modules/sails/node_modules/async/lib/async.js:32:24)
    at Object.async.each (/usr/local/lib/node_modules/sails/node_modules/async/lib/async.js:107:9)
    at Hook.startORM (/usr/local/lib/node_modules/sails/lib/hooks/orm/index.js:164:10)
    at Array.bound [as 1] (/usr/local/lib/node_modules/sails/node_modules/lodash/dist/lodash.js:729:21)
    at listener (/usr/local/lib/node_modules/sails/node_modules/async/lib/async.js:462:46)
    at /usr/local/lib/node_modules/sails/node_modules/async/lib/async.js:416:17
    at Array.forEach (native)
    at _each (/usr/local/lib/node_modules/sails/node_modules/async/lib/async.js:32:24)
    at Object.taskComplete (/usr/local/lib/node_modules/sails/node_modules/async/lib/async.js:415:13)
    at processImmediate [as _immediateCallback] (timers.js:330:15)
Problem courtesy of: user3156478

Solution

Based on the error you're getting from Waterline, it looks like a problem with your global Sails' dependencies. That's not the right version of Waterline for Sails 0.9.8. This can happen if you've been trying out other versions of Sails; the npm cache gets a little muddied-up. To correct it, do the following:

  1. sudo npm uninstall sails -g
  2. npm cache clear
  3. sudo npm install sails -g

That will reinstall Sails with all of the correct dependencies. You shouldn't have to change your project.

Solution courtesy of: sgress454

Discussion

View additional discussion.



This post first appeared on Node.js Recipes, please read the originial post: here

Share the post

sails 0.9.8 not work, when created controller and lift it

×

Subscribe to Node.js Recipes

Get updates delivered right to your inbox!

Thank you for your subscription

×