react-native-android - 错误:错误:无法解析模块操作系统
问题描述
每当我尝试在我的设备上运行我的 react 本机应用程序进行测试时,我都会收到错误“无法解析模块操作系统”错误我正在尝试使用 nodemailer 和谷歌 Oauth 测试发送电子邮件,但我无法解决该错误,在这里下面是我的代码
应用程序.js
try{
const accessToken = await oAuthClient.getAccessToken();
const authOptions = {
service: 'gmail',
auth: {
type: 'OAuth2',
user: 'user@gmail.com',
clientId: 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
clientSecret: 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
refreshToken: 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
accessToken: 'xxxxxxxxxxxxxxxxxxxxxxxxxxxx'
}
};
let transport = nodemailer.createTransport(authOptions);
const data = {
from: 'fromemail <fromemail@example.com>',
to: 'to@gexample.com',
subject: 'testing email',
text: 'Testing Email!',
html: '<h1>testing email </h1>'
}
const result = await transport.sendMail(data);
return result;
}catch(error){
return error;
}
解决方案
推荐阅读
- python - 从 TFX/setuptools 禁用无用的日志/输出
- javascript - 使用 Prettier VS Code 删除 Vue 文件中的括号包装
- r - 如何在 flexdashboard 中放置对象
- c# - VS 代码 - 未找到“.NETFramework,Version=v5.0”的参考程序集
- reactjs - 为什么在 NextJS 的 getInitialProps 中使用使用 axios.post 请求
- c# - 将鼠标悬停在 url RichTextBox 上时更改光标
- amazon-web-services - 访问 s3 资源的最安全方式是什么?
- ruby - SQLPLUS / OCI8 => ORA-12154: TNS: 无法解析指定的连接标识符 (OCIError)
- python - Python:如何将文字字节附加到没有解码的字符串?
- vtk - 如何在不写/读文件的情况下直接在VTK和netgen之间传递数据?