Error when running puppeteer-core AWS layer












0















I am not 100% where the issue is when I attempt to create a puppeteer-core layer for AWS. On a Linux box I install the package, zip it up, and then create a layer in AWS Lambda.



ubuntu@ip-172-30-0-25:~$ npm i puppeteer-core
ubuntu@ip-172-30-0-25:~$ npm pack ./node_modules/puppeteer-core/
npm notice
npm notice 📦 puppeteer-core@1.11.0
npm notice === Tarball Contents ===
puppeteer-core-1.11.0.tgz


Then I create the .zip file for upload to AWS layers



mkdir --parents nodejs/node_modules/puppeteer-core-1.11.0/ && 
tar --directory nodejs/node_modules/puppeteer-core-1.11.0/ --extract --file
puppeteer-core-1.11.0*.tgz --strip-components=1 &&
rm puppeteer-core-1.11.0*.tgz &&
zip -9 --filesync --move --recurse-paths _/puppeteer-core.zip nodejs/


But I get the following error when attempting to run this sample code which makes me think there is something missing from the package when I am creating it?



{
"errorMessage": "Cannot find module 'debug'",
"errorType": "Error",
"stackTrace": [
"Function.Module._load (module.js:474:25)",
"Module.require (module.js:596:17)",
"require (internal/module.js:11:18)",
"Object.<anonymous> (/opt/nodejs/node_modules/puppeteer-core-1.11.0/lib/helper.js:18:20)",
"Module._compile (module.js:652:30)",
"Object.Module._extensions..js (module.js:663:10)",
"Module.load (module.js:565:32)",
"tryModuleLoad (module.js:505:12)",
"Function.Module._load (module.js:497:3)"
]
}


enter image description here










share|improve this question



























    0















    I am not 100% where the issue is when I attempt to create a puppeteer-core layer for AWS. On a Linux box I install the package, zip it up, and then create a layer in AWS Lambda.



    ubuntu@ip-172-30-0-25:~$ npm i puppeteer-core
    ubuntu@ip-172-30-0-25:~$ npm pack ./node_modules/puppeteer-core/
    npm notice
    npm notice 📦 puppeteer-core@1.11.0
    npm notice === Tarball Contents ===
    puppeteer-core-1.11.0.tgz


    Then I create the .zip file for upload to AWS layers



    mkdir --parents nodejs/node_modules/puppeteer-core-1.11.0/ && 
    tar --directory nodejs/node_modules/puppeteer-core-1.11.0/ --extract --file
    puppeteer-core-1.11.0*.tgz --strip-components=1 &&
    rm puppeteer-core-1.11.0*.tgz &&
    zip -9 --filesync --move --recurse-paths _/puppeteer-core.zip nodejs/


    But I get the following error when attempting to run this sample code which makes me think there is something missing from the package when I am creating it?



    {
    "errorMessage": "Cannot find module 'debug'",
    "errorType": "Error",
    "stackTrace": [
    "Function.Module._load (module.js:474:25)",
    "Module.require (module.js:596:17)",
    "require (internal/module.js:11:18)",
    "Object.<anonymous> (/opt/nodejs/node_modules/puppeteer-core-1.11.0/lib/helper.js:18:20)",
    "Module._compile (module.js:652:30)",
    "Object.Module._extensions..js (module.js:663:10)",
    "Module.load (module.js:565:32)",
    "tryModuleLoad (module.js:505:12)",
    "Function.Module._load (module.js:497:3)"
    ]
    }


    enter image description here










    share|improve this question

























      0












      0








      0








      I am not 100% where the issue is when I attempt to create a puppeteer-core layer for AWS. On a Linux box I install the package, zip it up, and then create a layer in AWS Lambda.



      ubuntu@ip-172-30-0-25:~$ npm i puppeteer-core
      ubuntu@ip-172-30-0-25:~$ npm pack ./node_modules/puppeteer-core/
      npm notice
      npm notice 📦 puppeteer-core@1.11.0
      npm notice === Tarball Contents ===
      puppeteer-core-1.11.0.tgz


      Then I create the .zip file for upload to AWS layers



      mkdir --parents nodejs/node_modules/puppeteer-core-1.11.0/ && 
      tar --directory nodejs/node_modules/puppeteer-core-1.11.0/ --extract --file
      puppeteer-core-1.11.0*.tgz --strip-components=1 &&
      rm puppeteer-core-1.11.0*.tgz &&
      zip -9 --filesync --move --recurse-paths _/puppeteer-core.zip nodejs/


      But I get the following error when attempting to run this sample code which makes me think there is something missing from the package when I am creating it?



      {
      "errorMessage": "Cannot find module 'debug'",
      "errorType": "Error",
      "stackTrace": [
      "Function.Module._load (module.js:474:25)",
      "Module.require (module.js:596:17)",
      "require (internal/module.js:11:18)",
      "Object.<anonymous> (/opt/nodejs/node_modules/puppeteer-core-1.11.0/lib/helper.js:18:20)",
      "Module._compile (module.js:652:30)",
      "Object.Module._extensions..js (module.js:663:10)",
      "Module.load (module.js:565:32)",
      "tryModuleLoad (module.js:505:12)",
      "Function.Module._load (module.js:497:3)"
      ]
      }


      enter image description here










      share|improve this question














      I am not 100% where the issue is when I attempt to create a puppeteer-core layer for AWS. On a Linux box I install the package, zip it up, and then create a layer in AWS Lambda.



      ubuntu@ip-172-30-0-25:~$ npm i puppeteer-core
      ubuntu@ip-172-30-0-25:~$ npm pack ./node_modules/puppeteer-core/
      npm notice
      npm notice 📦 puppeteer-core@1.11.0
      npm notice === Tarball Contents ===
      puppeteer-core-1.11.0.tgz


      Then I create the .zip file for upload to AWS layers



      mkdir --parents nodejs/node_modules/puppeteer-core-1.11.0/ && 
      tar --directory nodejs/node_modules/puppeteer-core-1.11.0/ --extract --file
      puppeteer-core-1.11.0*.tgz --strip-components=1 &&
      rm puppeteer-core-1.11.0*.tgz &&
      zip -9 --filesync --move --recurse-paths _/puppeteer-core.zip nodejs/


      But I get the following error when attempting to run this sample code which makes me think there is something missing from the package when I am creating it?



      {
      "errorMessage": "Cannot find module 'debug'",
      "errorType": "Error",
      "stackTrace": [
      "Function.Module._load (module.js:474:25)",
      "Module.require (module.js:596:17)",
      "require (internal/module.js:11:18)",
      "Object.<anonymous> (/opt/nodejs/node_modules/puppeteer-core-1.11.0/lib/helper.js:18:20)",
      "Module._compile (module.js:652:30)",
      "Object.Module._extensions..js (module.js:663:10)",
      "Module.load (module.js:565:32)",
      "tryModuleLoad (module.js:505:12)",
      "Function.Module._load (module.js:497:3)"
      ]
      }


      enter image description here







      node.js amazon-web-services aws-lambda puppeteer






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Jan 1 at 17:28









      juanald_reaganjuanald_reagan

      789




      789
























          1 Answer
          1






          active

          oldest

          votes


















          0














          I was missing dependencies (debug being the first one) that NPM installed for the puppeteer-core package in the nodejs/node_modules. Make sure to include those dependencies in your layer and it should work.






          share|improve this answer























            Your Answer






            StackExchange.ifUsing("editor", function () {
            StackExchange.using("externalEditor", function () {
            StackExchange.using("snippets", function () {
            StackExchange.snippets.init();
            });
            });
            }, "code-snippets");

            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "1"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53997488%2ferror-when-running-puppeteer-core-aws-layer%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            0














            I was missing dependencies (debug being the first one) that NPM installed for the puppeteer-core package in the nodejs/node_modules. Make sure to include those dependencies in your layer and it should work.






            share|improve this answer




























              0














              I was missing dependencies (debug being the first one) that NPM installed for the puppeteer-core package in the nodejs/node_modules. Make sure to include those dependencies in your layer and it should work.






              share|improve this answer


























                0












                0








                0







                I was missing dependencies (debug being the first one) that NPM installed for the puppeteer-core package in the nodejs/node_modules. Make sure to include those dependencies in your layer and it should work.






                share|improve this answer













                I was missing dependencies (debug being the first one) that NPM installed for the puppeteer-core package in the nodejs/node_modules. Make sure to include those dependencies in your layer and it should work.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Jan 10 at 1:38









                juanald_reaganjuanald_reagan

                789




                789
































                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Stack Overflow!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53997488%2ferror-when-running-puppeteer-core-aws-layer%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    Monofisismo

                    Angular Downloading a file using contenturl with Basic Authentication

                    Olmecas