Typescript + angular groceries tutorial codebase moving from Kinvey to Firebase

firebase

#1

Maybe I am trying to bite off more than I can chew, but I am trying to learn by modifying the only project that I have working which is based on typescript + angular groceries tutorial (playground). I decided to build my first app based on this codebase with more features added, changed interface etc.

So, currently I am trying to move from kinvey to firebase backend. Following this article by Jen Looper

I am sure I am doing it wrong at this point, but I manage to reduce the number of errors during tns run, and that is a sufficient reward for now… The tutorial uses a different folder structure and I am just sticking bits of code around. So far I was able to eliminate all errors, but one.
My code changes are below.

/app/shared/config.ts

export class Config {
    static apiUrl = "https://xxxxxxxxxx.firebaseio.com/";
    //static appKey = "kid_HyHoT_REf";
   //static authHeader = "Basic 2lkX0h5SG9UX1JFZjo1MTkxMDJlZWFhMzQ0MzMyODFjN2MyODM3MGQ5OTIzMQ";
   //static token = "";

}

/app/login/login.component.ts

Added this.userService.init(); to LoginComponent class constructor

/app/shared/user/user.service.ts

On top, added
import firebase = require("nativescript-plugin-firebase");

To export class UserService {

added methods init(), login(), register() :

init (){	
		firebase.init({
			url: Config.apiUrl
		  }).then(
			  function (instance) {
				console.log("firebase.init done");
			  },
			  function (error) {
				console.log("firebase.init error: " + error);
			  }
		  );
	}

register(user: User) {
 return firebase.createUser({
	email: user.email,
	password: user.password
	}).then( 
	function
	(response) {
		console.log(response);
		return response;
		}
	)
}

login(user: User) {
    firebase.login({  
        type: firebase.LoginType.PASSWORD,
        email: user.password,      
        password: user.password
    }).then(
        function
        (response) {
            //Config.uid = response.uid
           return response;
        });	
}

tns run error:

app/login/login.component.ts(25,19): error TS2339: Property 'init' does not exist on type 'UserService'.

VSC PROBLEMS (1):

Argument of type '{ url: string; }' is not assignable to parameter of type 'InitOptions'.
Object literal may only specify known properties, and 'url' does not exist in type 'InitOptions'.

Any guidance is greatly appreciated.


#2

Hey @b-and-p,

Sorry for the late reply here. Did you have any luck getting this up and running?

app/login/login.component.ts(25,19): error TS2339: Property 'init' does not exist on type 'UserService'.

This error makes me think that you have a syntactical issue in your user.service.ts file, and that this isn’t necessarily a Firebase problem.

What you might want to do is start a new app using the Firebase template in NativeScript Sidekick, so that you can refer to a functioning Firebase app and go from there.

Also ping @jen.looper > what’s the best {N} + Firebase reference we have on GitHub right now?

TJ


#3

@tjvantoll Hi, thanks for taking time for this!

Actually, yes, I had some progress - I was going through loops with a bunch of different issues, but it appears to boil down to some dependency incompatibility concerning android-services, firebase and geolocation plugs. I removed geolocation from my package, edited my ts code and the thing now compiles (I couldn’t believe it!.

The app is actually talking to firebase now - wrong email format, missing facebook AppID etc. But I feel victorious nevertheless.
It is late where I am now (UTC+8), I will post details on my progress tomorrow. Cheers!


#4

Awesome @b-and-p! Glad you got this working :smile:


#5

Last week I was battling with the following error:

Please fix the version conflict either by updating the version of the google-services plugin
(information about the latest version is available at https://bintray.com/android/android-
tools/com.google.gms.google-services/) or updating the version
of com.google.android.gms to 11.4.0.

I’ve followed instructions from SO and other resources, basically advising to edit build.gradle files to add maven to repositories:

maven { url "https://maven.google.com"  }

and update google-services to the latest version:

//classpath "com.google.gms:google-services:3.1.1"
 classpath 'com.google.gms:google-services:3.2.0'

I’ve done a bunch of such edits, still could not finish the build (perhaps because of npm/gradle proxy issue as well).
Finally, yesterday I removed the geolocation plugin and edited my TS code in user.service,ts as follows:

  init (){

   let opt = Object();
   opt.url = Config.apiUrl;

    firebase.init(opt).then(
          function (instance) {
            console.log("firebase.init done");
          },
          function (error) {
            console.log("firebase.init error: " + error);
          }
      );
} 

I am still very new no TS and have no idea why I cannot assign object literal to argument of type any, but it worked the way shown above.

the app would launch on device with the following terminal output:

zion@zion-VirtualBox ~/ns_projects/myList $ tns devices

Connected devices & emulators
Searching for devices...
iTunes is not available for this operating system. You will not be able to work with connected iOS devices.
+---------------------------------------------------------------------+
¦ # ¦ Device Name ¦ Platform ¦ Device Identifier ¦ Type   ¦ Status    ¦
¦ 1 ¦ t03gxx      ¦ Android  ¦ 4df71211a4d1bffb  ¦ Device ¦ Connected ¦
+---------------------------------------------------------------------+
zion@zion-VirtualBox ~/ns_projects/myList $ tns run android
Searching for devices...
Executing before-prepare hook from /home/zion/ns_projects/myList/hooks/before-prepare/nativescript-dev-typescript.js
Found peer TypeScript 2.5.3
Executing before-prepare hook from /home/zion/ns_projects/myList/hooks/before-prepare/nativescript-plugin-firebase.js
Preparing project...
Project successfully prepared (Android)
Executing after-prepare hook from /home/zion/ns_projects/myList/hooks/after-prepare/firebase-build-gradle.js
Configure firebase
Executing after-prepare hook from /home/zion/ns_projects/myList/hooks/after-prepare/firebase-copy-google-services.js
Copy /home/zion/ns_projects/myList/app/App_Resources/Android/google-services.json to /home/zion/ns_projects/myList/platforms/android/google-services.json.
Executing after-prepare hook from /home/zion/ns_projects/myList/hooks/after-prepare/nativescript-plugin-firebase.js
Refreshing application...
Successfully synced application com.bytesandpixels.app0001 on device 4df71211a4d1bffb.
Executing before-watch hook from /home/zion/ns_projects/myList/hooks/before-watch/nativescript-dev-typescript.js
Found peer TypeScript 2.5.3
ActivityManager: mDVFSHelper.acquire()
ActivityManager: mDVFSHelper.release()
ActivityManager: mDVFSHelper.acquire()
ActivityManager: mDVFSHelper.release()
ActivityManager: Launch timeout has expired, giving up wake lock!
ActivityManager: Process com.samsung.android.MtpApplication (pid 2653) (adj 0) has died.
ActivityManager: Process com.samsung.android.MtpApplication (pid 21892) (adj 0) has died.
ActivityManager: Process com.samsung.android.MtpApplication (pid 22033) (adj 0) has died.
ActivityManager: mDVFSHelper.acquire()
ActivityManager: mDVFSHelper.release()
ActivityManager: Process com.samsung.android.MtpApplication (pid 22142) (adj 0) has died.
JS: Error in firebase.init: Error: A valid Facebook app id must be set in the AndroidManifest.xml or set by calling FacebookSdk.setApplicationId before initializing the sdk.
JS:     com.facebook.FacebookSdk.sdkInitialize(FacebookSdk.java:275)
JS:     com.facebook.FacebookSdk.sdkInitialize(FacebookSdk.java:231)
JS:     com.tns.Runtime.runScript(Native Method)
JS:     com.tns.Runtime.access$2200(Runtime.java:34)
JS:     com.tns.Runtime$2.run(Runtime.java:551)
JS:     android.os.Handler.handleCallback(Handler.java:733)
JS:     android.os.Handler.dispatchMessage(Handler.java:95)
JS:     android.os.Looper.loop(Looper.java:146)
JS:     android.app.ActivityThread.main(ActivityThread.java:5602)
JS:     java.lang.reflect.Method.invokeNative(Native Method)
JS:     java.lang.reflect.Method.invoke(Method.java:515)
JS:     com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1283)
JS:     com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1099)
JS:     dalvik.system.NativeStart.main(Native Method)
JS: firebase.init error: Firebase already initialized
JS: ANGULAR BOOTSTRAP DONE. 355848
JS: Please update your code: the 'email' property is deprecated and now expected at 'passwordOptions.email'
JS: Please update your code: the 'password' property is deprecated and now expected at 'passwordOptions.password'
D/dalvikvm(22757): Note: class Landroid/app/ActivityManagerNative; has 192 unimplemented (abstract) methods
ActivityManager: Force removing ActivityRecord{424eb4f0 u0 com.bytesandpixels.app0001/com.tns.NativeScriptActivity t55}: app died, no saved state
ActivityManager: mDVFSHelper.acquire()
W/WindowManager( 2472): 	at com.android.server.am.ActivityManagerService.forceStopPackageLocked(ActivityManagerService.java:5916)
W/WindowManager( 2472): 	at com.android.server.am.ActivityManagerService.forceStopPackageLocked(ActivityManagerService.java:5652)
W/WindowManager( 2472): 	at com.android.server.am.ActivityManagerService.forceStopPackage(ActivityManagerService.java:5483)
W/WindowManager( 2472): 	at android.app.ActivityManagerNative.onTransact(ActivityManagerNative.java:1455)
W/WindowManager( 2472): 	at com.android.server.am.ActivityManagerService.onTransact(ActivityManagerService.java:2645)
ActivityManager: mDVFSHelper.release()
D/dalvikvm(22772): Note: class Landroid/app/ActivityManagerNative; has 192 unimplemented (abstract) methods
D/dalvikvm(22795): Note: class Landroid/app/ActivityManagerNative; has 192 unimplemented (abstract) methods
ActivityManager: mDVFSHelper.acquire()
ActivityManager: mDVFSHelper.release()
7:04:10 PM - Compilation complete. Watching for file changes.



JS: Error in firebase.init: Error: A valid Facebook app id must be set in the AndroidManifest.xml or set by calling FacebookSdk.setApplicationId before initializing the sdk.
JS:     com.facebook.FacebookSdk.sdkInitialize(FacebookSdk.java:275)
JS:     com.facebook.FacebookSdk.sdkInitialize(FacebookSdk.java:231)
JS:     com.tns.Runtime.callJSMethodNative(Native Method)
JS:     com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1088)
JS:     com.tns.Runtime.callJSMethodImpl(Runtime.java:970)
JS:     com.tns.Runtime.callJSMethod(Runtime.java:957)
JS:     com.tns.Runtime.callJSMethod(Runtime.java:941)
JS:     com.tns.Runtime.callJSMethod(Runtime.java:933)
JS:     com.tns.NativeScriptActivity.onStart(NativeScriptActivity.java:44)
JS:     android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1177)
JS:     android.app.Activity.performStart(Activity.java:5461)
JS:     android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2386)
JS:     android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2471)
JS:     android.app.ActivityThread.access$900(ActivityThread.java:175)
JS:     android.app.ActivityThread$H.handleMessage(ActivityThread.java:1308)
JS:     android.os.Handler.dispatchMessage(Handler.java:102)
JS:     android.os.Looper.loop(Looper.java:146)
JS:     android.app.ActivityThread.main(ActivityThread.java:5602)
JS:     java.lang.reflect.Method.invokeNative(Native Method)
JS:     java.lang.reflect.Method.invoke(Method.java:515)
JS:     com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1283)
JS:     com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1099)
JS:     dalvik.system.NativeStart.main(Native Method)
JS: firebase.init error: Error: A valid Facebook app id must be set in the AndroidManifest.xml or set by calling FacebookSdk.setApplicationId before initializing the sdk.
JS:     com.facebook.FacebookSdk.sdkInitialize(FacebookSdk.java:275)
JS:     com.facebook.FacebookSdk.sdkInitialize(FacebookSdk.java:231)
JS:     com.tns.Runtime.callJSMethodNative(Native Method)
JS:     com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1088)
JS:     com.tns.Runtime.callJSMethodImpl(Runtime.java:970)
JS:     com.tns.Runtime.callJSMethod(Runtime.java:957)
JS:     com.tns.Runtime.callJSMethod(Runtime.java:941)
JS:     com.tns.Runtime.callJSMethod(Runtime.java:933)
JS:     com.tns.NativeScriptActivity.onStart(NativeScriptActivity.java:44)
JS:     android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1177)
JS:     android.app.Activity.performStart(Activity.java:5461)
JS:     android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2386)
JS:     android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2471)
JS:     android.app.ActivityThread.access$900(ActivityThread.java:175)
JS:     android.app.ActivityThread$H.handleMessage(ActivityThread.java:1308)
JS:     android.os.Handler.dispatchMessage(Handler.java:102)
JS:     android.os.Looper.loop(Looper.java:146)
JS:     android.app.ActivityThread.main(ActivityThread.java:5602)
JS:     java.lang.reflect.Method.invokeNative(Native Method)
JS:     java.lang.reflect.Method.invoke(Method.java:515)
JS:     com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1283)
JS:     com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1099)
JS:     dalvik.system.NativeStart.main(Native Method)
JS: ANGULAR BOOTSTRAP DONE. 9301
JS: Please update your code: the 'email' property is deprecated and now expected at 'passwordOptions.email'
JS: Please update your code: the 'password' property is deprecated and now expected at 'passwordOptions.password'
ActivityManager: Launch timeout has expired, giving up wake lock!
JS: Logging in the user failed. com.google.firebase.auth.FirebaseAuthInvalidCredentialsException: The email address is badly formatted.
JS: ERROR Error: Uncaught (in promise): Logging in the user failed. com.google.firebase.auth.FirebaseAuthInvalidCredentialsException: The email address is badly formatted.
ActivityManager: mDVFSHelper.acquire()
ActivityManager: mDVFSHelper.release()
JS: Please update your code: the 'email' property is deprecated and now expected at 'passwordOptions.email'
JS: Please update your code: the 'password' property is deprecated and now expected at 'passwordOptions.password'
JS: Logging in the user failed. com.google.firebase.auth.FirebaseAuthInvalidCredentialsException: The email address is badly formatted.
JS: ERROR Error: Uncaught (in promise): Logging in the user failed. com.google.firebase.auth.FirebaseAuthInvalidCredentialsException: The email address is badly formatted.

After I tinkered a bit with the code, the app launches on the device, but liveSync dies immediately. That is where I am so far:

Connected devices & emulators
Searching for devices...
iTunes is not available for this operating system. You will not be able to work with connected iOS devices.
+---------------------------------------------------------------------+
¦ # ¦ Device Name ¦ Platform ¦ Device Identifier ¦ Type   ¦ Status    ¦
¦ 1 ¦ t03gxx      ¦ Android  ¦ 4df71211a4d1bffb  ¦ Device ¦ Connected ¦
+---------------------------------------------------------------------+
zion@zion-VirtualBox ~/ns_projects/myList $ tns run android
Searching for devices...
Executing before-prepare hook from /home/zion/ns_projects/myList/hooks/before-prepare/nativescript-dev-typescript.js
Found peer TypeScript 2.5.3
Executing before-prepare hook from /home/zion/ns_projects/myList/hooks/before-prepare/nativescript-plugin-firebase.js
Preparing project...
Project successfully prepared (Android)
Executing after-prepare hook from /home/zion/ns_projects/myList/hooks/after-prepare/firebase-build-gradle.js
Configure firebase
Executing after-prepare hook from /home/zion/ns_projects/myList/hooks/after-prepare/firebase-copy-google-services.js
Copy /home/zion/ns_projects/myList/app/App_Resources/Android/google-services.json to /home/zion/ns_projects/myList/platforms/android/google-services.json.
Executing after-prepare hook from /home/zion/ns_projects/myList/hooks/after-prepare/nativescript-plugin-firebase.js
Refreshing application...
Successfully synced application com.bytesandpixels.app0001 on device 4df71211a4d1bffb.
Executing before-watch hook from /home/zion/ns_projects/myList/hooks/before-watch/nativescript-dev-typescript.js
Found peer TypeScript 2.5.3
1:01:13 PM - Compilation complete. Watching for file changes.



Error: watch /home/zion/ns_projects/myList/app/App_Resources/Android/settings.json ENOSPC
	at exports._errnoException (util.js:1020:11)
	at FSWatcher.start (fs.js:1451:19)
	at Object.fs.watch (fs.js:1478:11)
	at createFsWatchInstance (/usr/local/lib/node_modules/nativescript/node_modules/chokidar/lib/nodefs-handler.js:37:15)
	at setFsWatchListener (/usr/local/lib/node_modules/nativescript/node_modules/chokidar/lib/nodefs-handler.js:80:15)
	at FSWatcher.NodeFsHandler._watchWithNodeFs (/usr/local/lib/node_modules/nativescript/node_modules/chokidar/lib/nodefs-handler.js:228:14)
	at FSWatcher.NodeFsHandler._handleFile (/usr/local/lib/node_modules/nativescript/node_modules/chokidar/lib/nodefs-handler.js:255:21)
	at FSWatcher.<anonymous> (/usr/local/lib/node_modules/nativescript/node_modules/chokidar/lib/nodefs-handler.js:473:21)
	at FSReqWrap.oncomplete (fs.js:123:15)
Error: watch /home/zion/ns_projects/myList/app/App_Resources/iOS/Assets.xcassets ENOSPC
	at exports._errnoException (util.js:1020:11)
	at FSWatcher.start (fs.js:1451:19)
	at Object.fs.watch (fs.js:1478:11)
	at createFsWatchInstance (/usr/local/lib/node_modules/nativescript/node_modules/chokidar/lib/nodefs-handler.js:37:15)
	at setFsWatchListener (/usr/local/lib/node_modules/nativescript/node_modules/chokidar/lib/nodefs-handler.js:80:15)
	at FSWatcher.NodeFsHandler._watchWithNodeFs (/usr/local/lib/node_modules/nativescript/node_modules/chokidar/lib/nodefs-handler.js:228:14)
	at FSWatcher.NodeFsHandler._handleDir (/usr/local/lib/node_modules/nativescript/node_modules/chokidar/lib/nodefs-handler.js:407:19)
	at FSWatcher.<anonymous> (/usr/local/lib/node_modules/nativescript/node_modules/chokidar/lib/nodefs-handler.js:455:19)
	at FSWatcher.<anonymous> (/usr/local/lib/node_modules/nativescript/node_modules/chokidar/lib/nodefs-handler.js:460:16)
	at FSReqWrap.oncomplete (fs.js:123:15)
Error: watch /home/zion/ns_projects/myList/app/App_Resources/iOS/Info.plist ENOSPC
	at exports._errnoException (util.js:1020:11)
	at FSWatcher.start (fs.js:1451:19)
	at Object.fs.watch (fs.js:1478:11)
	at createFsWatchInstance (/usr/local/lib/node_modules/nativescript/node_modules/chokidar/lib/nodefs-handler.js:37:15)
	at setFsWatchListener (/usr/local/lib/node_modules/nativescript/node_modules/chokidar/lib/nodefs-handler.js:80:15)
	at FSWatcher.NodeFsHandler._watchWithNodeFs (/usr/local/lib/node_modules/nativescript/node_modules/chokidar/lib/nodefs-handler.js:228:14)
	at FSWatcher.NodeFsHandler._handleFile (/usr/local/lib/node_modules/nativescript/node_modules/chokidar/lib/nodefs-handler.js:255:21)
	at FSWatcher.<anonymous> (/usr/local/lib/node_modules/nativescript/node_modules/chokidar/lib/nodefs-handler.js:473:21)
	at FSReqWrap.oncomplete (fs.js:123:15)
Error: watch /home/zion/ns_projects/myList/app/App_Resources/iOS/LaunchScreen.storyboard ENOSPC
	at exports._errnoException (util.js:1020:11)
	at FSWatcher.start (fs.js:1451:19)
	at Object.fs.watch (fs.js:1478:11)
	at createFsWatchInstance (/usr/local/lib/node_modules/nativescript/node_modules/chokidar/lib/nodefs-handler.js:37:15)
	at setFsWatchListener (/usr/local/lib/node_modules/nativescript/node_modules/chokidar/lib/nodefs-handler.js:80:15)
	at FSWatcher.NodeFsHandler._watchWithNodeFs (/usr/local/lib/node_modules/nativescript/node_modules/chokidar/lib/nodefs-handler.js:228:14)
	at FSWatcher.NodeFsHandler._handleFile (/usr/local/lib/node_modules/nativescript/node_modules/chokidar/lib/nodefs-handler.js:255:21)
	at FSWatcher.<anonymous> (/usr/local/lib/node_modules/nativescript/node_modules/chokidar/lib/nodefs-handler.js:473:21)
	at FSReqWrap.oncomplete (fs.js:123:15)
Error: watch /home/zion/ns_projects/myList/app/App_Resources/iOS/build.xcconfig ENOSPC
	at exports._errnoException (util.js:1020:11)
	at FSWatcher.start (fs.js:1451:19)
	at Object.fs.watch (fs.js:1478:11)
	at createFsWatchInstance (/usr/local/lib/node_modules/nativescript/node_modules/chokidar/lib/nodefs-handler.js:37:15)
	at setFsWatchListener (/usr/local/lib/node_modules/nativescript/node_modules/chokidar/lib/nodefs-handler.js:80:15)
	at FSWatcher.NodeFsHandler._watchWithNodeFs (/usr/local/lib/node_modules/nativescript/node_modules/chokidar/lib/nodefs-handler.js:228:14)
	at FSWatcher.NodeFsHandler._handleFile (/usr/local/lib/node_modules/nativescript/node_modules/chokidar/lib/nodefs-handler.js:255:21)
	at FSWatcher.<anonymous> (/usr/local/lib/node_modules/nativescript/node_modules/chokidar/lib/nodefs-handler.js:473:21)
	at FSReqWrap.oncomplete (fs.js:123:15)
Error: watch /home/zion/ns_projects/myList/app/shared/grocery/grocery.model.js ENOSPC
	at exports._errnoException (util.js:1020:11)
	at FSWatcher.start (fs.js:1451:19)
	at Object.fs.watch (fs.js:1478:11)
	at createFsWatchInstance (/usr/local/lib/node_modules/nativescript/node_modules/chokidar/lib/nodefs-handler.js:37:15)
	at setFsWatchListener (/usr/local/lib/node_modules/nativescript/node_modules/chokidar/lib/nodefs-handler.js:80:15)
	at FSWatcher.NodeFsHandler._watchWithNodeFs (/usr/local/lib/node_modules/nativescript/node_modules/chokidar/lib/nodefs-handler.js:228:14)
	at FSWatcher.NodeFsHandler._handleFile (/usr/local/lib/node_modules/nativescript/node_modules/chokidar/lib/nodefs-handler.js:255:21)
	at FSWatcher.<anonymous> (/usr/local/lib/node_modules/nativescript/node_modules/chokidar/lib/nodefs-handler.js:473:21)
	at FSReqWrap.oncomplete (fs.js:123:15)
Error: watch /home/zion/ns_projects/myList/app/shared/grocery/grocery.model.ts ENOSPC
	at exports._errnoException (util.js:1020:11)
	at FSWatcher.start (fs.js:1451:19)
	at Object.fs.watch (fs.js:1478:11)
	at createFsWatchInstance (/usr/local/lib/node_modules/nativescript/node_modules/chokidar/lib/nodefs-handler.js:37:15)
	at setFsWatchListener (/usr/local/lib/node_modules/nativescript/node_modules/chokidar/lib/nodefs-handler.js:80:15)
	at FSWatcher.NodeFsHandler._watchWithNodeFs (/usr/local/lib/node_modules/nativescript/node_modules/chokidar/lib/nodefs-handler.js:228:14)
	at FSWatcher.NodeFsHandler._handleFile (/usr/local/lib/node_modules/nativescript/node_modules/chokidar/lib/nodefs-handler.js:255:21)
	at FSWatcher.<anonymous> (/usr/local/lib/node_modules/nativescript/node_modules/chokidar/lib/nodefs-handler.js:473:21)
	at FSReqWrap.oncomplete (fs.js:123:15)
Error: watch /home/zion/ns_projects/myList/app/shared/grocery/grocery.service.js ENOSPC
	at exports._errnoException (util.js:1020:11)
	at FSWatcher.start (fs.js:1451:19)
	at Object.fs.watch (fs.js:1478:11)
	at createFsWatchInstance (/usr/local/lib/node_modules/nativescript/node_modules/chokidar/lib/nodefs-handler.js:37:15)
	at setFsWatchListener (/usr/local/lib/node_modules/nativescript/node_modules/chokidar/lib/nodefs-handler.js:80:15)
	at FSWatcher.NodeFsHandler._watchWithNodeFs (/usr/local/lib/node_modules/nativescript/node_modules/chokidar/lib/nodefs-handler.js:228:14)
	at FSWatcher.NodeFsHandler._handleFile (/usr/local/lib/node_modules/nativescript/node_modules/chokidar/lib/nodefs-handler.js:255:21)
	at FSWatcher.<anonymous> (/usr/local/lib/node_modules/nativescript/node_modules/chokidar/lib/nodefs-handler.js:473:21)
	at FSReqWrap.oncomplete (fs.js:123:15)
Error: watch /home/zion/ns_projects/myList/app/shared/grocery/grocery.service.ts ENOSPC
	at exports._errnoException (util.js:1020:11)
	at FSWatcher.start (fs.js:1451:19)
	at Object.fs.watch (fs.js:1478:11)
	at createFsWatchInstance (/usr/local/lib/node_modules/nativescript/node_modules/chokidar/lib/nodefs-handler.js:37:15)
	at setFsWatchListener (/usr/local/lib/node_modules/nativescript/node_modules/chokidar/lib/nodefs-handler.js:80:15)
	at FSWatcher.NodeFsHandler._watchWithNodeFs (/usr/local/lib/node_modules/nativescript/node_modules/chokidar/lib/nodefs-handler.js:228:14)
	at FSWatcher.NodeFsHandler._handleFile (/usr/local/lib/node_modules/nativescript/node_modules/chokidar/lib/nodefs-handler.js:255:21)
	at FSWatcher.<anonymous> (/usr/local/lib/node_modules/nativescript/node_modules/chokidar/lib/nodefs-handler.js:473:21)
	at FSReqWrap.oncomplete (fs.js:123:15)
Error: watch /home/zion/ns_projects/myList/app/shared/user/user.model.js ENOSPC
	at exports._errnoException (util.js:1020:11)
	at FSWatcher.start (fs.js:1451:19)
	at Object.fs.watch (fs.js:1478:11)
	at createFsWatchInstance (/usr/local/lib/node_modules/nativescript/node_modules/chokidar/lib/nodefs-handler.js:37:15)
	at setFsWatchListener (/usr/local/lib/node_modules/nativescript/node_modules/chokidar/lib/nodefs-handler.js:80:15)
	at FSWatcher.NodeFsHandler._watchWithNodeFs (/usr/local/lib/node_modules/nativescript/node_modules/chokidar/lib/nodefs-handler.js:228:14)
	at FSWatcher.NodeFsHandler._handleFile (/usr/local/lib/node_modules/nativescript/node_modules/chokidar/lib/nodefs-handler.js:255:21)
	at FSWatcher.<anonymous> (/usr/local/lib/node_modules/nativescript/node_modules/chokidar/lib/nodefs-handler.js:473:21)
	at FSReqWrap.oncomplete (fs.js:123:15)
Error: watch /home/zion/ns_projects/myList/app/shared/user/user.model.ts ENOSPC
	at exports._errnoException (util.js:1020:11)
	at FSWatcher.start (fs.js:1451:19)
	at Object.fs.watch (fs.js:1478:11)
	at createFsWatchInstance (/usr/local/lib/node_modules/nativescript/node_modules/chokidar/lib/nodefs-handler.js:37:15)
	at setFsWatchListener (/usr/local/lib/node_modules/nativescript/node_modules/chokidar/lib/nodefs-handler.js:80:15)
	at FSWatcher.NodeFsHandler._watchWithNodeFs (/usr/local/lib/node_modules/nativescript/node_modules/chokidar/lib/nodefs-handler.js:228:14)
	at FSWatcher.NodeFsHandler._handleFile (/usr/local/lib/node_modules/nativescript/node_modules/chokidar/lib/nodefs-handler.js:255:21)
	at FSWatcher.<anonymous> (/usr/local/lib/node_modules/nativescript/node_modules/chokidar/lib/nodefs-handler.js:473:21)
	at FSReqWrap.oncomplete (fs.js:123:15)
Error: watch /home/zion/ns_projects/myList/app/shared/user/user.service.js ENOSPC
	at exports._errnoException (util.js:1020:11)
	at FSWatcher.start (fs.js:1451:19)
	at Object.fs.watch (fs.js:1478:11)
	at createFsWatchInstance (/usr/local/lib/node_modules/nativescript/node_modules/chokidar/lib/nodefs-handler.js:37:15)
	at setFsWatchListener (/usr/local/lib/node_modules/nativescript/node_modules/chokidar/lib/nodefs-handler.js:80:15)
	at FSWatcher.NodeFsHandler._watchWithNodeFs (/usr/local/lib/node_modules/nativescript/node_modules/chokidar/lib/nodefs-handler.js:228:14)
	at FSWatcher.NodeFsHandler._handleFile (/usr/local/lib/node_modules/nativescript/node_modules/chokidar/lib/nodefs-handler.js:255:21)
	at FSWatcher.<anonymous> (/usr/local/lib/node_modules/nativescript/node_modules/chokidar/lib/nodefs-handler.js:473:21)
	at FSReqWrap.oncomplete (fs.js:123:15)
Error: watch /home/zion/ns_projects/myList/app/shared/user/user.service.ts ENOSPC
	at exports._errnoException (util.js:1020:11)
	at FSWatcher.start (fs.js:1451:19)
	at Object.fs.watch (fs.js:1478:11)
	at createFsWatchInstance (/usr/local/lib/node_modules/nativescript/node_modules/chokidar/lib/nodefs-handler.js:37:15)
	at setFsWatchListener (/usr/local/lib/node_modules/nativescript/node_modules/chokidar/lib/nodefs-handler.js:80:15)
	at FSWatcher.NodeFsHandler._watchWithNodeFs (/usr/local/lib/node_modules/nativescript/node_modules/chokidar/lib/nodefs-handler.js:228:14)
	at FSWatcher.NodeFsHandler._handleFile (/usr/local/lib/node_modules/nativescript/node_modules/chokidar/lib/nodefs-handler.js:255:21)
	at FSWatcher.<anonymous> (/usr/local/lib/node_modules/nativescript/node_modules/chokidar/lib/nodefs-handler.js:473:21)
	at FSReqWrap.oncomplete (fs.js:123:15)
zion@zion-VirtualBox ~/ns_projects/myList $

Edit 1

The liveSync errors ENOSPC appear to be fixed by following this: