EddyVerbruggen / nativescript-localize

Internationalization plugin for NativeScript using native capabilities of each platform
MIT License
79 stars 31 forks source link

Running demo-angular fails #44

Closed airandfingers closed 6 years ago

airandfingers commented 6 years ago

Hi, I've been having trouble getting this plugin to work in my Nativescript Angular project, so I decided to see if I could get your demo-angular folder to work.

However, after running npm i in this directory, I tried tns debug android and got an error:

~/nativescript-localize/demo-angular$ tns debug android
Searching for devices...
Executing before-liveSync hook from ~/nativescript-localize/demo-angular/hooks/before-liveSync/nativescript-angular-sync.js
Executing before-prepare hook from ~/nativescript-localize/demo-angular/hooks/before-prepare/nativescript-dev-typescript.js
Found peer TypeScript 2.4.2
Executing before-prepare hook from ~/nativescript-localize/demo-angular/hooks/before-prepare/nativescript-localize.js

Unable to apply changes on device: emulator-5554. Error is: Cannot find module 'nativescript-localize/hooks/before-prepare.js'.

Executing after-watch hook from ~/nativescript-localize/demo-angular/hooks/after-watch/nativescript-dev-typescript.js
Executing after-watch hook from ~/nativescript-localize/demo-angular/hooks/after-watch/nativescript-dev-webpack.js

I'm using tns version 3.4.3, and I've tried the above both on master and on 0e534b0 (a couple commits before Nativescript 4.0 support was added).

Am I missing something with how I'm running demo-angular?

lfabreges commented 6 years ago

demo-angular installs the nativescript-localize dependency using file://... To work as expected, you need to compile the plugin and run npm i from the demo-angular folder using node version 6.

Try updating the demo's package.json file to download the npmjs version of the plugin instead of the local one.