已安装推杆模块,但未找到

时间:2020-02-11 10:14:59

标签: amazon-web-services pusher adonis.js

以下收到错误:

Error: Cannot find module 'Pusher'
Require stack:
- /home/ec2-user/realtime_map/node_modules/require-stack/src/index.js
- /home/ec2-user/realtime_map/node_modules/require-stack/index.js
- /home/ec2-user/realtime_map/node_modules/@adonisjs/fold/src/Ioc/index.js
- /home/ec2-user/realtime_map/node_modules/@adonisjs/fold/index.js
- /home/ec2-user/realtime_map/server.js

at /home/ec2-user/realtime_map/start/events.js(anonymous):3
1      //events.js
2
3      const Pusher = use('Pusher')
4      const Event = use('Event');
5      const Env = use('Env');
6
7      // set up Pusher
8      let pusher = new Pusher({

1 requireStack
  /home/ec2-user/realtime_map/node_modules/require-stack/src/index.js:44

2 Ioc._require
  /home/ec2-user/realtime_map/node_modules/@adonisjs/fold/src/Ioc/index.js:345

3 Ioc.use
  /home/ec2-user/realtime_map/node_modules/@adonisjs/fold/src/Ioc/index.js:742

Application crashed, make sure to kill all related running process, fix the issue and re-run the app

已安装的pusher版本是

adonis-fullstack-app@4.1.0 / home / ec2-user / realtime_map └──pusher@3.0.0

adonis-fullstack-app@4.1.0 / home / ec2-user / realtime_map └──adonis-pusher@1.0.4

1 个答案:

答案 0 :(得分:0)

您的错误表明找不到模块名称Pusher,但是正在安装您的安装说明pusher。 您可以在导入中尝试使用小写的p吗?

const Pusher = use('pusher')