简体   繁体   English

如何修复显示“找不到模块'mailosaur'”的错误

[英]How do i fix an error that reads "Cannot find module 'mailosaur'"

i am running a puppeteer script and it seems i have to declare a mailosaur stack for me to proceed with my code.我正在运行一个 puppeteer 脚本,看来我必须为我声明一个 mailosaur 堆栈才能继续我的代码。 I am running a node.js script in aws cloudwatch.我在 aws cloudwatch 中运行 node.js 脚本。 here is me defining the stack, and the code follows suit.这是我定义堆栈,代码如下。

const synthetics = require('Synthetics');
const MailosaurClient = require('mailosaur');
const log = require('SyntheticsLogger');
const puppeteer = require('puppeteer-core');
const url = require('url');
const { v4: uuidv4 } = require('uuid');

await synthetics.executeStep('Assert the email was received', async function () {
      const mailosaur = new MailosaurClient(`${process.env.MAILOSAUR_API_KEY}`);
      const serverId = ''
      const serverDomain = `${serverId}.mailosaur.net`

      const searchCriteria = {
          sentTo: `${patientEmailAddress}@${serverDomain}`
      }

      const message = await mailosaur.messages.get(serverId, searchCriteria)
      const dom = new JSDOM(message.html.body);
      const el = dom.window.document.querySelector('p.em_defaultlink > a');
      target = el.href;
    });

 

the error reads错误读取

RROR: Canary error: Error: Cannot find module 'mailosaur'Require stack:- /opt/nodejs/node_modules/daniels-1.js- /var/task/index.js- /var/runtime/UserFunction.js- /var/runtime/index.js Stack: Error: Cannot find module 'mailosaur' RROR:金丝雀错误:错误:找不到模块'mailosaur'需要堆栈:- /opt/nodejs/node_modules/daniels-1.js- /var/task/index.js- /var/runtime/UserFunction.js- /var /runtime/index.js 堆栈:错误:找不到模块“mailosaur”

the error says it cannot find the module mailosaur.错误说它找不到模块 mailosaur。 you just need to install it.你只需要安装它。

you need to run你需要跑

npm install mailosaur;

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 接收找不到模块错误,我该如何解决? - Receiving cannot find module error, how do I fix it? 如何修复“错误:找不到模块'./src/bot/index'” - how to fix "Error: Cannot find module './src/bot/index'" 如何修复运行“找不到模块”错误的 docker 容器? - How to fix docker container running 'cannot find module' error? 如何修复 Node JS 错误 cannot find module 'express' on heroku? - How to fix Node JS error cannot find module 'express' on heroku? 如何修复“找不到模块 './commands/${file}'” - How can i fix “Cannot find module './commands/${file}'” react-scripts 启动错误(找不到模块'../scripts/start') - 我该如何解决这个问题? - react-scripts start error (Cannot find module '../scripts/start') - how can i fix this? 如何修复在 Angular 4 中找不到模块“打字稿”? - How to fix Cannot find module 'typescript' in Angular 4? 我正在尝试运行 node.js,如何解决“找不到模块”错误? - I am trying to run node.js, how do I resolve "Cannot find module" error? 我如何解决我的Typescript版本中的错误“找不到模块'jquery'” - How do i solve error “cannot find module 'jquery'” in my Typescript build 指向分支时如何解决“找不到模块”? - How do I resolve “Cannot find module” when pointing to a branch?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM