nativescript-liveedit icon indicating copy to clipboard operation
nativescript-liveedit copied to clipboard

Node watcher not found - ios Support

Open StephanAtG2 opened this issue 9 years ago • 20 comments

For some reason i cannot get the node watcher to start module.js:327 throw err; ^

Error: Cannot find module 'C:\navitescriptprojects\newP\infoApp\watcher' at Function.Module._resolveFilename (module.js:325:15) at Function.Module._load (module.js:276:25) at Function.Module.runMain (module.js:441:10) at startup (node.js:134:18) at node.js:962:3 PS C:\navitescriptprojects\newP\infoApp>

I used your version of the android runtime for nativescript from http://nativescript.rocks/ xmllint installed and nativescript runtime also installed from your site. The app can deploy perfectly using native script but cannot for the life of me figure out why the watcher is not starting. Is the watcher not suppose to work by default or am i missing something

StephanAtG2 avatar Feb 23 '16 09:02 StephanAtG2

How did you install the liveedit plugin?
Did you do: tns plugin add nativescript-liveedit

NathanaelA avatar Feb 23 '16 23:02 NathanaelA

I have the same problem, i already installed liveedit plugin and added require into app.js. But still tells me cannot find module project/node when i perform 'node watcher' into the project root folder. Using nativescript 1.6.1, node 4.3.1

thanks in advance

demym avatar Feb 25 '16 22:02 demym

What happens if you type "node --version" at a command prompt?

NathanaelA avatar Feb 25 '16 23:02 NathanaelA

I nave noce 4.3.1

demym avatar Feb 26 '16 06:02 demym

Node 4.3.1 i meant

demym avatar Feb 26 '16 06:02 demym

@demym - I wasn't asking which version, I wanted to know if node ran properly. So if you go to the command line and type node --version does it print out the version or bad command or filename

NathanaelA avatar Feb 26 '16 16:02 NathanaelA

Hi, any news on this?

I'm Having the same issue

gaffel avatar Mar 10 '16 12:03 gaffel

Found the problem. I had to install android sdk as well because the postscript execution was crashing.

Now I'm having this issue:

--------------------------------------------------------------------------------------------------- This version of LiveEdit does not support the version of the Android runtimes you have. This is probably because you have updated to a newer version of the NativeScript Android runtimes. A new version of NativeScript-LiveEdit should be released shortly. ---------------------------------------------------------------------------------------------------

gaffel avatar Mar 10 '16 14:03 gaffel

@gaffel Oh, very interesting; The Telerik team snuck out another android runtime update; it will be resolved shortly. Based on the changelog it looks like it was pushed yesterday (edit, actually misread the change log; it was pushed a couple days ago -- I just totally missed it). I'll have this fixed very shortly. :grinning:

NathanaelA avatar Mar 10 '16 14:03 NathanaelA

@gaffel Ok, the new version has been pushed. Just do a tns plugin remove nativescript-liveedit then a tns plugin add nativescript-liveedit and you should get you the latest version with the 1.63 runtimes.

NathanaelA avatar Mar 10 '16 15:03 NathanaelA

@NathanaelA, it seems to work now, but encountered another issue which I'm not sure it's related to liveedit in particular, but it's worth a shot to see if anybody ran into it. So now after I'm running "node watcher", I'm getting this error:

error: no devices found Error: error: no devices found 24

Which is weird because if I'm running tns run ios it works just fine.

Thanks!

gaffel avatar Mar 10 '16 21:03 gaffel

Sorry, that is expected. My liveedit plugin does not yet support iOS; only Android. The normal built in LiveSync by Telerik does support both.

NathanaelA avatar Mar 10 '16 22:03 NathanaelA

Hello, I am getting same error again when doing "tns plugin add nativescript-liveedit" for Android target.

"--------------------------------------------------------------------------------------------------- This version of LiveEdit does not support the version of the Android runtimes you have. This is probably because you have updated to a newer version of the NativeScript Android runtimes. A new version of NativeScript-LiveEdit should be released shortly. ---------------------------------------------------------------------------------------------------"

I am using latest android SDK.

TIA

HarisHashim avatar May 15 '17 14:05 HarisHashim

This has not been updated for 2.5 or 3.0 yet. For the most part the Telerik LiveSync handles syncing fairly well now, so my LiveEdit has been a much lower priority.

NathanaelA avatar May 15 '17 15:05 NathanaelA

Thanks for the fast reply.

I am using Visual Studio Code and NativeScript plugin that allow me to debug and do the so called LiveSync.

When using actual device, the LiveSync will restart app on my device and lost state. (EDIT: I have never tried emulator, but I suspect it will do the same).

From my understanding, nativescript-liveedit will not restart the app for changes like XML and CSS right?

I am quite new at this, but if the hot reload behavior for Native Script is to restart the app (and lost state), I might as well just go back to React Native.

Thanks again!

HarisHashim avatar May 15 '17 15:05 HarisHashim

Yeah, that is one things that LiveEdit does do over LiveSync; I just haven't done any updates to this since there was several other projects that were more important to me.

NathanaelA avatar May 15 '17 16:05 NathanaelA

OK, I thought I was doing something wrong. Appreciate that confirmation about how Telerik Live Sync works on Visual Studio Code.

I am pretty sure that the Live Sync works properly when we pay a lot of money for Telerik App Builder. Base on this link (http://docs.telerik.com/platform/appbuilder/cordova/livesync/using-livesync)

HarisHashim avatar May 15 '17 23:05 HarisHashim

@NathanaelA If there is guide how to self patch this issue. I might give it a try.

[EDIT]

I go ahead to troubleshoot by manually copying following files from postinstall.js::function copyFiles(convert)

/support/watcher.js /support/watcher.entities /support/.jshintrc /support/tslint.json

The command "node watcher" run with the following console output. My thought after:

CONSOLE OUT


NativeScript LiveEdit Watcher v0.21 (c)2015, 2016, Master Technology. www.master-technology.com

Watching your project: org.nativescript.Seller Error: 0

Checking updated file: ./app/main-page.xml Using backup method for updates! Failed to Push to Device: ./app/main-page.xml { Error: Command failed: adb push "./app/main-page.xml" "/data/data/org.nativescript.Seller/files/./app/main-page.xml"

at ChildProcess.exithandler (child_process.js:206:12)
at emitTwo (events.js:106:13)
at ChildProcess.emit (events.js:191:7)
at maybeClose (internal/child_process.js:877:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)

killed: false, code: 1, signal: null, cmd: 'adb push "./app/main-page.xml" "/data/data/org.nativescript.Seller/files/./app/main-page.xml"' }

Checking updated file: ./app/main-page.xml Pushed to Device: ./app/main-page.xml /data/local/tmp/org.nativescript.Seller/main-page%2Exml

Checking updated file: ./app/main-page.xml Pushed to Device: ./app/main-page.xml /data/local/tmp/org.nativescript.Seller/main-page%2Exml

My Thought

=> The first error (Error: Command failed: adb push ) is because I have my code debugging running at the same time in VS Code (should be same as tns run). => After noticing the first error, I stop debugging and it looks like the watcher is working! I.e. it is pushing changes to my device. =>However no UI changes happened in my android app that is being tested. Even after closing and restarting the app, expected changes (changing button text from "TAP" to "CLICK"). => My conclusion so far is that possibly you are patching the NativeScript runtime to make things work. So at the moment it is not working since the runtime in my android device and app is not using the file that is being pushed by watcher through ADB. => The next question will be how to make this work, either patching the runtime or if I misunderstood that, how to do something else :D

HarisHashim avatar May 15 '17 23:05 HarisHashim

Actually Telerik is working on live changes; but I haven't been successful in getting it to work -- and it only works on iOS at this moment. As for mine, yeah it needs a patched runtime. This is on my list to get updated; I just haven't had time.

The patch is actually in the tns-android repo as a closed pull request that they didn't accept. I thought I linked to it from the docs. If you still have a issue finding it let me know and I'll track it down, but right now I'm on vacation... ;-)

Nathanael a.

NathanaelA avatar May 17 '17 03:05 NathanaelA

Thanks for the insight. I have move on to React Native and Flutter (by Google but still in Alpha).

Will follow this thread and give Native Script another try whenever your plugin got patched.

But, I think Flutter might be the next big thing in this space. Flutter IDE support (Intellij Idea Community Edition) and their implementation of Hot Reload is top notch.

HarisHashim avatar May 24 '17 16:05 HarisHashim