Error: Cannot find module 'passport-oauth'



  • I'm trying to node app, but getting the error

    Error: Cannot find module 'passport-oauth'
    

    First, why is it missing? Everything else works. Is that module required by the sso-oauth plugin?

    How would I go about installing that module? Something like, npm install passport-oauth?



  • OK, I've attempted to install "passport-oauth" and encounter this error:

    $ npm install passport-oauth
    npm ERR! Linux 4.4.0-66-generic
    npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install" "passport-oauth"
    npm ERR! node v6.10.1
    npm ERR! npm  v3.10.10
    npm ERR! path /home/forge/community.ttgn.com/public/node_modules/nodebb-plugin-sso-oauth
    npm ERR! code EISGIT
    
    npm ERR! git /home/forge/community.ttgn.com/public/node_modules/nodebb-plugin-sso-oauth: Appears to be a git repo or submodule.
    npm ERR! git     /home/forge/community.ttgn.com/public/node_modules/nodebb-plugin-sso-oauth
    npm ERR! git Refusing to remove it. Update manually,
    npm ERR! git or move it out of the way first.
    
    npm ERR! Please include the following file with any support request:
    npm ERR!     /home/forge/community.ttgn.com/public/node_modules/npm-debug.log
    forge@breezy-waterfall:~/community.ttgn.com/public/node_modules$
    

    Can anybody help me with this?


  • Global Moderator

    @c.k.-lester run npm ls passport-oauth. Try running rm -rf node_modules/nodebb-plugin-sso-oauth then running npm install nodebb-plugin-sso-oauth.

    What is your distribution method? You shouldn't be committing the node_modules folder to your distribution repo if that's what you're doing.


  • Admin

    This is in a fork of sso-oauth, right? When you cloned the repo into your node_modules/ folder, did you run npm install afterwards from inside the cloned folder?



  • @PitaJ said in Error: Cannot find module 'passport-oauth':

    @c.k.-lester run npm ls passport-oauth. Try running rm -rf node_modules/nodebb-plugin-sso-oauth then running npm install nodebb-plugin-sso-oauth.

    What is your distribution method? You shouldn't be committing the node_modules folder to your distribution repo if that's what you're doing.

    The only repo in node_modules/ is nodebb-plugin-sso-oauth. I'm pulling it from my forked repo, which the NodeBB docs tell me to do. I probably misunderstood something. 😕

    I will attempt to fix it with your instructions above.

    Thank you!



  • @PitaJ Your suggested solution has worked for me. So, now NodeBB is running with the sso-oauth plugin activated. Thank you!

    On the login screen, I get a prompt for "Alternative Logins," but I want to set it up so that any login happens on the MAIN site. I'm assuming it will work like this:

    1. User is on community site.
    2. User clicks "Login"
    3. User redirected to main site for login.
    4. User logs in.
    5. User redirected back to community site, with credentials.
    6. User is logged in to community site.

    Is that how it's going to work at this point?


  • Admin

    Yes. If you have sso-oauth configured and it works (when you click the checkbox icon), logs you in, and redirects you back, then you can go ahead and disable local login and set registration to "No registration", in the ACP.

    NodeBB is smart enough to automatically send users to the configured SSO endpoint when the login button is clicked.



  • @julian I get the "Congrats! So far so good -- please see server log for details" message, but when I comment out the two lines (as suggested), I get this error:

    EXECABORT Transaction discarded because of previous errors.
    

    I have no idea what that means.


    After further research, it seems to be an error caused by redis running out of memory.


    After increasing the available RAM for my server to 1GB, I'm still getting this error.


    After increasing swapfile size to 4GB, I'm still getting this error.


Log in to reply
 


Star

Looks like your connection to NodeBB was lost, please wait while we try to reconnect.