如何解决快速模块映射中不存在模块“ crypto”
试图在React native中实现Pusher Beam,但收到以下错误。
错误:捆绑失败:错误:无法解析
crypto
中的模块PROJECT-DIRECTORY\node_modules\@pusher\push-notifications-server\utils.js
:急速模块映射中不存在模块crypto
有关此步骤https://pusher.com/tutorials/push-notifications-android
,请参阅此文档在我的 App.js 中,我将完全相同的代码用于通知测试代码
const PushNotifications = require('@pusher/push-notifications-server');
let pushNotifications = new PushNotifications({
instanceId: 'YOUR_INSTANCE_ID_HERE',secretKey: 'YOUR_SECRET_KEY_HERE',});
pushNotifications
.publishToInterests(['hello'],{
fcm: {
notification: {
title: 'Hello World',body: 'Hello!',},})
.then(publishResponse => {
console.log('Just published:',publishResponse.publishId);
})
.catch(error => {
console.log('Error:',error);
});
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。