8 Replies Latest reply on Oct 8, 2016 3:34 PM by vangroover

    Cannot find module 'cordova'

    eversam1

      My app was building fine a few days ago and now I am getting this error.

       

      Any suggestions on what I can do to fix?

       

      "plugman install --platform android --project /project --plugin https://github.com/apla/me.apla.cordova.app-preferences.git": Fetching plugin "https://github.com/apla/me.apla.cordova.app-preferences.git" via git clone

      Using shallow clone

      Repository "https://github.com/apla/me.apla.cordova.app-preferences.git" checked out to git ref "master" at "4cf78e4".

      Installing "cordova-plugin-app-preferences" at "0.99.2" for android

      Failed to install 'cordova-plugin-app-preferences':Error: Cannot find module 'cordova'

        at Function.Module._resolveFilename (module.js:337:15)

        at Function.Module._load (module.js:287:25)

        at Module.require (module.js:366:17)

        at require (module.js:385:17)

        at Context.requireCordovaModule (/.npm/lib/node_modules/pgb-plugman/node_modules/pgb-cordova-lib/src/hooks/Context.js:77: 12)

        at module.exports (/project/cordova/plugins/cordova-plugin-app-preferences/bin/lib/android.js:11:13)

        at module.exports (/project/cordova/plugins/cordova-plugin-app-preferences/bin/after_plugin_install.js:9:37 )

        at runScriptViaModuleLoader (/.npm/lib/node_modules/pgb-plugman/node_modules/pgb-cordova-lib/src/hooks/HooksRunner.js :187:18)

        at runScript (/.npm/lib/node_modules/pgb-plugman/node_modules/pgb-cordova-lib/src/hooks/HooksRunner.js :165:16)

        at /.npm/lib/node_modules/pgb-plugman/node_modules/pgb-cordova-lib/src/hooks/HooksRunner.js: 133:20

      Cannot find module 'cordova'

       

       

      ===

      and then from the PGP dashboard, in Error box after clicking the "Error" button:

       

      Error - Plugin error (you probably need to remove plugin files from your app): //github.com/apla/me.apla.cordova.app-preferences.git": Fetching plugin "https://github.com/apla/me.apla.cordova.app-preferences.git" via git clone Using shallow clone Repository "https://github.com/apla/me.apla.cordova.app-preferences.git" checked out to git ref "master" at "4cf78e4". Installing "cordova-plugin-app-preferences" at "0.99.2" for android Failed to install 'cordova-plugin-app-preferences':Error: Cannot find module 'cordova' at Function.Module._resolveFilename (module.js:337:15) at Function.Module._load (module.js:287:25) at Module.require (module.js:366:17) at require (module.js:385:17) at Context.requireCordovaModule (/home/ec2-user/.npm/lib/node_modules/pgb-plugman/node_modules/pgb-cordova-lib/src/hooks/ Context.js:77:12) at module.exports (/tmp/gimlet/31198260/1949353/www_android/project/cordova/plugins/cordova-plugin-app-pref erences/bin/lib/android.js:11:13) at module.exports (/tmp/gimlet/31198260/1949353/www_android/project/cordova/plugins/cordova-plugin-app-pref erences/bin/after_plugin_install.js:9:37) at runScriptViaModuleLoader (/home/ec2-user/.npm/lib/node_modules/pgb-plugman/node_modules/pgb-cordova-lib/src/hooks/ HooksRunner.js:187:18) at runScript (/home/ec2-user/.npm/lib/node_modules/pgb-plugman/node_modules/pgb-cordova-lib/src/hooks/ HooksRunner.js:165:16) at /home/ec2-user/.npm/lib/node_modules/pgb-plugman/node_modules/pgb-cordova-lib/src/hooks/H ooksRunner.js:133:20 Cannot find module 'cordova' - You can fix this here

        • 1. Re: Cannot find module 'cordova'
          akadri Adobe Employee

          Plugins not working

           

          and

           

          Phonegap build fails building (Error: Cannot find module 'cordova' )

           

          seem to be related

           

          I escalated the issue. Thanks for your patience!

          • 2. Re: Cannot find module 'cordova'
            mkih40437034 Level 1

            Still the build fails using cli version 5.2.0:

             

            Error - Plugin error (you probably need to remove plugin files from your app): Fetching plugin "cordova-plugin-app-preferences@0.7.6" via npm Installing "cordova-plugin-app-preferences" at "0.7.5" for ios Using this version of Cordova with older version of cordova-ios is being deprecated. Consider upgrading to cordova-ios@4.0.0 or newer. Failed to install 'cordova-plugin-app-preferences':Error: Cannot find module 'cordova' at Function.Module._resolveFilename (module.js:337:15) at Function.Module._load (module.js:287:25) at Module.require (module.js:366:17) at require (module.js:385:17) at Context.requireCordovaModule (/usr/local/lib/node_modules/pgb-plugman/node_modules/pgb-cordova-lib/src/hooks/Context.j s:77:12) at module.exports (/private/tmp/gimlet/70173236659560/2156299/project/cordova/plugins/cordova-plugin-app-pr eferences/bin/lib/android.js:11:13) at module.exports (/private/tmp/gimlet/70173236659560/2156299/project/cordova/plugins/cordova-plugin-app-pr eferences/bin/after_plugin_install.js:9:37) at runScriptViaModuleLoader (/usr/local/lib/node_modules/pgb-plugman/node_modules/pgb-cordova-lib/src/hooks/HooksRunn er.js:187:18) at runScript (/usr/local/lib/node_modules/pgb-plugman/node_modules/pgb-cordova-lib/src/hooks/HooksRunn er.js:165:16) at /usr/local/lib/node_modules/pgb-plugman/node_modules/pgb-cordova-lib/src/hooks/HooksRunne r.js:133:20 Cannot find module 'cordova' - You can fix this here

             

            And with cli 6.3.0:

             

            Error - Plugin error (you probably need to remove plugin files from your app): Fetching plugin "cordova-plugin-app-preferences@0.7.6" via npm Installing "cordova-plugin-app-preferences" at "0.7.5" for ios Failed to install 'cordova-plugin-app-preferences':Error: Cannot find module 'cordova' at Function.Module._resolveFilename (module.js:337:15) at Function.Module._load (module.js:287:25) at Module.require (module.js:366:17) at require (module.js:385:17) at Context.requireCordovaModule (/usr/local/lib/node_modules/pgb-plugman/node_modules/pgb-cordova-lib/src/hooks/Context.j s:77:12) at module.exports (/private/tmp/gimlet/2156299/project/cordova/plugins/cordova-plugin-app-preferences/bin/l ib/android.js:11:13) at module.exports (/private/tmp/gimlet/2156299/project/cordova/plugins/cordova-plugin-app-preferences/bin/a fter_plugin_install.js:9:37) at runScriptViaModuleLoader (/usr/local/lib/node_modules/pgb-plugman/node_modules/pgb-cordova-lib/src/hooks/HooksRunn er.js:187:18) at runScript (/usr/local/lib/node_modules/pgb-plugman/node_modules/pgb-cordova-lib/src/hooks/HooksRunn er.js:165:16) at /usr/local/lib/node_modules/pgb-plugman/node_modules/pgb-cordova-lib/src/hooks/HooksRunne r.js:133:20 Cannot find module 'cordova' - You can fix this here

            • 3. Re: Cannot find module 'cordova'
              vangroover Adobe Employee

              what app id # is this so i can troubleshoot?

              • 4. Re: Cannot find module 'cordova'
                eversam1 Level 1

                vangroover the app id # is 1949353

                 

                Thank you for the quick response back.

                • 5. Re: Cannot find module 'cordova'
                  eversam1 Level 1

                  It built successfully.  However, I had to tweak my config.xml a bit.  It was saying that I was missing a param tag for one of the IAP plugins but I wasn't missing it.  I moved that plugin further up within the file and it built successfully.

                  • 6. Re: Cannot find module 'cordova'
                    mkih40437034 Level 1

                    PGB is now back to normal.

                    • 7. Re: Cannot find module 'cordova'
                      bau720123

                      I have the similar problem and it build all success a few days ago,but now failure

                      my appid is 697726

                      the log message show these error info

                      Android︰"plugman install --platform ios --project /project --plugin ": Cannot find plugin.xml for plugin "plugins". Please try adding it again.

                      iOS︰"plugman install --platform android --project /project --plugin ": Cannot find plugin.xml for plugin "plugins". Please try adding it again.

                      Windows︰"plugman.cmd install --platform windows --project /cygwin/tmp/gimlet/697726/project --plugin ": Cannot find plugin.xml for plugin "plugins". Please try adding it again.

                      • 8. Re: Cannot find module 'cordova'
                        vangroover Adobe Employee

                        the spec attribute should be used for the git location of a git sourced plugin not the name. this is to be compatible with the cordova cli.