wejs / we

[Deprecated] See @go-catupiri as a direct golang port
MIT License
214 stars 54 forks source link

Error while running "npm run dev" command #141

Closed sirigina closed 8 years ago

sirigina commented 8 years ago

I created an app with yo using the following command and chose the app name as "troop" $yo wejs:app

Then ran "$npm install" in the new project folder successfully

After that, when I try to run the following command, I am getting error while creating admin user. In the MySQL database, I can see that the user is successfully inserted into users table. What am I missing?

$ npm run dev

we-project-troop@0.3.0 dev /Users/sirigina/projects/we/we-project-troop node app.js --dev

2016-05-18T04:46:51.963Z - info: Plugin we-core installed 2016-05-18T04:46:51.976Z - info: Plugin we-core registered with id: 1 2016-05-18T04:46:51.976Z - info: Plugin we-plugin-bootstrap3 dont have install method 2016-05-18T04:46:51.982Z - info: Plugin we-plugin-bootstrap3 registered with id: 2 2016-05-18T04:46:52.025Z - info: Plugin we-plugin-file installed 2016-05-18T04:46:52.029Z - info: Plugin we-plugin-file registered with id: 3 2016-05-18T04:46:52.029Z - info: Plugin we-plugin-form dont have install method 2016-05-18T04:46:52.032Z - info: Plugin we-plugin-form registered with id: 4 2016-05-18T04:46:52.032Z - info: Plugin we-plugin-menu dont have install method 2016-05-18T04:46:52.036Z - info: Plugin we-plugin-menu registered with id: 5 2016-05-18T04:46:52.062Z - info: Plugin we-plugin-vocabulary installed 2016-05-18T04:46:52.068Z - info: Plugin we-plugin-vocabulary registered with id: 6 2016-05-18T04:46:52.069Z - info: Starting project install... 2016-05-18T04:46:52.069Z - info: I will create the user:
{ username: 'administrator', biography: 'The administrator user account!', email: 'contato@albertosouza.net', password: '123', displayName: 'Administrator', language: 'en-us', active: true, roles: [ 'administrator' ] } Unhandled rejection TypeError: Cannot read property 'options' of undefined at Object.afterCreatedRecord (/Users/sirigina/projects/we/we-project-troop/node_modules/we-core/lib/Router/Alias.js:159:28) at tryCatcher (/Users/sirigina/projects/we/we-project-troop/node_modules/bluebird/js/release/util.js:16:23) at ret (eval at (/Users/sirigina/projects/we/we-project-troop/node_modules/bluebird/js/release/promisify.js:184:12), :13:39) at /Users/sirigina/projects/we/we-project-troop/node_modules/sequelize/lib/hooks.js:141:19 at tryCatcher (/Users/sirigina/projects/we/we-project-troop/node_modules/bluebird/js/release/util.js:16:23) at Object.gotValue (/Users/sirigina/projects/we/we-project-troop/node_modules/bluebird/js/release/reduce.js:145:18) at Object.gotAccum (/Users/sirigina/projects/we/we-project-troop/node_modules/bluebird/js/release/reduce.js:134:25) at Object.tryCatcher (/Users/sirigina/projects/we/we-project-troop/node_modules/bluebird/js/release/util.js:16:23) at Promise._settlePromiseFromHandler (/Users/sirigina/projects/we/we-project-troop/node_modules/bluebird/js/release/promise.js:502:31) at Promise._settlePromise (/Users/sirigina/projects/we/we-project-troop/node_modules/bluebird/js/release/promise.js:559:18) at Promise._settlePromise0 (/Users/sirigina/projects/we/we-project-troop/node_modules/bluebird/js/release/promise.js:604:10) at Promise._settlePromises (/Users/sirigina/projects/we/we-project-troop/node_modules/bluebird/js/release/promise.js:683:18) at Promise._fulfill (/Users/sirigina/projects/we/we-project-troop/node_modules/bluebird/js/release/promise.js:628:18) at /Users/sirigina/projects/we/we-project-troop/node_modules/bluebird/js/release/nodeback.js:42:21 at /Users/sirigina/projects/we/we-project-troop/node_modules/we-core/node_modules/async/lib/async.js:726:13 at /Users/sirigina/projects/we/we-project-troop/node_modules/we-core/node_modules/async/lib/async.js:52:16

albertosouza commented 8 years ago

@sirigina thanks,

The problem: Sequelize changed options attributes in model hooks. I fixed this in we-core@1.3.1 and updated the generator-wejs.

To update you project:

related commit: https://github.com/wejs/we-core/commit/2edaa2ace4c976105b1f443fe727427aaa1f6f16

sirigina commented 8 years ago

@albertosouza Thank you for the quick reply. I have updated the generator-wejs and tried again. Unfortunately, yo starts and terminates immediately. $ yo wejs:app troop

 _-----_
|       |    .--------------------------.
|--(o)--|    | We.js simple app project |

---------´ | generator! |o/ |o/ | ( _´U_ ) | generate one testable | /_A\ | we.js project! | | ~ | '--------------------------' **'.**.'__
´ |° ´ Y

$

albertosouza commented 8 years ago

Ok @sirigina , thanks. I updated generator-wejs to new yeoman API version and fixed the tests.

Please update both with:

albertosouza commented 8 years ago

Updating the generator will solve this problem then i will close this issue. Thanks for the feedback and reopen if need something