Skip to content
This repository has been archived by the owner on Aug 22, 2023. It is now read-only.

Error: Invalid plugin options {} #12

Open
lutfor3737 opened this issue Mar 4, 2016 · 13 comments
Open

Error: Invalid plugin options {} #12

lutfor3737 opened this issue Mar 4, 2016 · 13 comments
Labels

Comments

@lutfor3737
Copy link

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
Copy link
Collaborator

devinivy commented Mar 5, 2016

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
Copy link
Author

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
Copy link
Collaborator

devinivy commented Mar 5, 2016

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
Copy link
Author

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
Copy link
Author

i am looking forward a guidance from your end.

@lutfor3737
Copy link
Author

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
Copy link

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
Copy link
Author

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
Copy link

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
Copy link
Author

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

@devinivy
Copy link
Collaborator

devinivy commented Mar 7, 2016

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
Copy link
Author

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

@pabshazon
Copy link

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants