Urigo / Ionic2CLI-Meteor-WhatsApp

WhatsApp Clone tutorial with Ionic 2.0 CLI and Meteor Server
https://www.angular-meteor.com/tutorials/whatsapp2/ionic/setup
163 stars 185 forks source link

Cannot find module "meteor-client" #70

Closed mscherer82 closed 7 years ago

mscherer82 commented 7 years ago

I cloned the repo and run

npm install
ionic serve

I tried the latest master and tag master-0.0.5 and both gave me the following error in client browser:

Runtime Error
Cannot find module "meteor-client"
Stack
Error: Cannot find module "meteor-client"
    at webpackMissingModule (http://localhost:8100/build/main.js:142119:65)
    at Object.<anonymous> (http://localhost:8100/build/main.js:142119:155)
    at __webpack_require__ (http://localhost:8100/build/main.js:20:30)
    at http://localhost:8100/build/main.js:66:18
    at http://localhost:8100/build/main.js:69:10
Ionic Framework: 2.0.0-rc.5
Ionic Native: 2.2.11
Ionic App Scripts: 1.0.0
Angular Core: 2.2.1
Angular Compiler CLI: 2.2.1
Node: 6.10.0
OS Platform: Windows 7
Navigator Platform: Win32
User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36
gotu commented 7 years ago

If you follow the steps in the tutorial, there will be an 'meteor-client' module, which will be build by the meteor-client-bundler: https://github.com/Urigo/meteor-client-bundler

If you don't want to read the tutorial, then your question is probably this one: https://github.com/Urigo/Ionic2CLI-Meteor-WhatsApp/issues/51

In short you want to do something like this.

First Install meteor-client-bundler globaly, if not installed: $ npm install -g meteor-client-bundler

Then

$ git clone https://github.com/Urigo/Ionic2CLI-Meteor-WhatsApp.git
$ cd Ionic2CLI-Meteor-WhatsApp/
$ meteor npm install sharp
$ npm install
$ npm run meteor-client:bundle
$ npm run api
$ ionic serve
mscherer82 commented 7 years ago

Thank you for your quick response.
I had to remove sharp because of a gyp error and now I'm getting the errors from https://github.com/Urigo/Ionic2CLI-Meteor-WhatsApp/issues/56 even when I call ionic serve. I changed the types to any and now I can see the app on my screen.

gotu commented 7 years ago

if you allready run npm install once before, then "wrong" sharp will be installed, because it's defined in the packages.json, but that sharp is not compatible with the server..

you have to explicitly install sharp with "meteor npm install sharp" before your run npm install the first time.. if you installed sharp with npm remove it an install it like described here:

https://github.com/Urigo/Ionic2CLI-Meteor-WhatsApp/blob/master%400.0.5/manuals/views/step12.md#server-side

$ meteor npm install --save sharp
Be sure to use meteor npm and not npm, and that's because we wanna make sure that sharp is compatible with the server.
JonathanLehner commented 7 years ago

I noticed that there are some wrong plugins on the config file, which led to a crash when I tried git clone. In fact it seems there are quite a lot of differences between the tutorial and the github repo, a few node packages and especially the cordova fb and fcm plugins (and functions in methods.ts). When I clone it, it crashes.

--Update: found the explanation for the new code, and gonna check why it is not working easily.

darkbasic commented 7 years ago

The tutorial has been refactored, but I still didn't upload it on the main site. If you want you can still find the old version of the tutorial here.

bretonio commented 6 years ago

Running npm install -g meteor-client-bundler solved the mystery of the missing meteor-client for me and I thank you.