oneblink / hapi-oauth2orize

A bridge between hapi and OAuth2orize
BSD 3-Clause "New" or "Revised" License
27 stars 17 forks source link

Error: Invalid plugin options {} #12

Open lutfor3737 opened 8 years ago

lutfor3737 commented 8 years ago

i am getting this error when i try to register.

throw new Error(msgs.join(' ') || 'Unknown error'); ^

Error: Invalid plugin options {}

[1] "0" must be a string at Object.exports.contain.exports.reachTemplate.exports.assert.condition as assert at Object.exports.apply (/Users/Lutfor/Documents/vincari-api/node_modules/hapi/lib/schema.js:17:10) at module.exports.internals.Plugin.internals.Plugin.register.each as register at Object. (/Users/Lutfor/Documents/vincari-api/dist/index.js:14:8) at Module._compile (module.js:413:34) at Object.Module._extensions..js (module.js:422:10) at Module.load (module.js:357:32) at Function.Module._load (module.js:314:12) at Function.Module.runMain (module.js:447:10) at startup (node.js:139:18) at node.js:999:3

devinivy commented 8 years ago

The error you're getting is coming from hapi, and it says that your plugin registrations (the first argument to server.register()) are being written incorrectly. Are you registering other plugins than hapi-oauth2orize? Can you post the registration code that's throwing the error?

lutfor3737 commented 8 years ago

i registered other plugin like joi,gulp,basic-auth. Right now i am registering this one with following code. server.register(require('hapi-oauth2orize'), function (err) { console.log(err); });

when i installed hapi-oauth2orize, i got following error. npm WARN EPEERINVALID hapi-oauth2orize@1.3.0 requires a peer of hapi@^7.x.x but none was installed.

devinivy commented 8 years ago

This means that hapi-oauth2orize v1.3 requires use of hapi v7, and you're using some other version. Try using hapi-oauth2orize v1.4, which should work with hapi v8+.

lutfor3737 commented 8 years ago

i am using hapi 13.0.0. when i installed hapi-oauth2orize, it installed hapi-oauth2orize v 1.3.0. do you have v 1.4?

when i am trying this command: sudo npm install hapi-oauth2orize@1.4.0 --save

getting following error.

npm ERR! No compatible version found: hapi-oauth2orize@1.4.0 npm ERR! Valid install targets: npm ERR! 1.3.0, 1.2.1, 1.2.0, 1.1.0, 0.0.7, 0.0.6, 0.0.5, 0.0.4, 0.0.2

can you please guide me?

lutfor3737 commented 8 years ago

i am looking forward a guidance from your end.

lutfor3737 commented 8 years ago

something weird thing i noticed when checked hapi-oauth2orize source code under node_modules folder. i am running this command to install: sudo npm install hapi-oauth2orize --save

i found (v 1.3.0) that index.js and package.js are different than index.js and package.json from (https://github.com/blinkmobile/hapi-oauth2orize v:1.4.0).

can anyone please tell me what i need to do to install this updated plugin?

jokeyrhyme commented 8 years ago

Compare the versions in our package.json, to the versions of other packages in your project's package.json. It would seem that there is a version conflict preventing the latest from being installed by npm.

lutfor3737 commented 8 years ago

boom was only conflicting package. I uninstall that. still npm getting old version. For working purpose, i manually replaced my(node_modules/hapi-oauth2orize) index.js and package.json file from this repository.

jokeyrhyme commented 8 years ago

Try using the SemVer calculator for NPM, and double-checking to see if your version strings actually mean what you think they mean: http://semver.npmjs.com/

lutfor3737 commented 8 years ago

version 1.4.0 is not even listed here at http://semver.npmjs.com/

devinivy commented 8 years ago

Ah, you're right! 1.4.0 should be tagged and published if everything seems in order... I realize it's not ideal, but in the meantime you could depend on the latest commit to this repo.

lutfor3737 commented 8 years ago

please publish version 1.4.0 otherwise it will make confusion for new user of hapi like mine.

pabshazon commented 8 years ago

I suggest you remove the package and reinstall it from the repo:

npm remove hapi-oauth2orize npm install --save https://github.com/blinkmobile/hapi-oauth2orize.git