julianlam / nodebb-plugin-session-sharing

Allows login sessions from your app to persist in NodeBB
MIT License
88 stars 65 forks source link

"/nodebb upgrade" failed #50

Closed DmitryAVasin closed 6 years ago

DmitryAVasin commented 6 years ago

Please update in the "upgrades/session_sharing_hash_to_zset.js" file line 3:

var db = require.main.require('./src/database');

to this:

var db = module.parent.require('./database');

julianlam commented 6 years ago

No objections to the change, but require.main should work... how is the plugin installed?

Maki-SA commented 6 years ago

@julianlam I changed line 3 to var db = require.main.require('../database'); and it works:

Parsing upgrade scripts...
OK | 1 script(s) found, 57 skipped
  → [2017/10/19] Convert remote-to-local user ID from hash to sorted set...
  → [2017/10/19] Convert remote-to-local user ID from hash to sorted set... OK
Schema update complete!

In plugin upgrade script, require.main module is /path/to/nodebb/src/cli/index.js

julianlam commented 6 years ago

v4.2.6