NativeScript / sample-Groceries

:green_apple: :pineapple: :strawberry: A NativeScript-built iOS and Android app for managing grocery lists
Apache License 2.0
485 stars 345 forks source link

Error is: Unexpected token ). Executing after-watch hook #307

Open moorthi07 opened 6 years ago

moorthi07 commented 6 years ago

After cloning, tns run android throws this error:

Unable to apply changes on device: emulator-5554. Error is: Unexpected token ). Executing after-watch hook from C:\demo_tutorials\sample-Groceries\hooks\after-watch\nativescript-dev-typescript.js

tns doctor NOTE: You can develop for iOS only on Mac OS X systems. To be able to work with iOS devices and projects, you need Mac OS X Mavericks or later.

Updates available ┌──────────────┬─────────────────┬────────────────┬──────────────────┐ │ Component │ Current version │ Latest version │ Information │ │ nativescript │ 3.4.0 │ 4.0.1 │ Update available │ │ tns-android │ 4.0.0 │ 4.0.1 │ Update available │ └──────────────┴─────────────────┴────────────────┴──────────────────┘

No issues were detected.

moorthi07 commented 6 years ago

Same problem with nativescript-sdk-examples-ng. Executing after-watch hook from C:\demo_tutorials\nativescript-sdk-examples-ng\hooks\after-watch\nativescript-dev-webpack.js Unexpected token ) -# run android

moorthi07 commented 6 years ago

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.1.2 (node_modules\chokidar\node_modules\fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"}) npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules\@angular\compiler-cli\node_modules\chokidar\node_modules\fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"}) npm WARN nativescript-angular@5.4.0-2018-05-04-01 requires a peer of tns-core-modules@^4.0.0 || >4.0.0- || >4.1.0- but none was installed. npm WARN extract-text-webpack-plugin@3.0.2 requires a peer of webpack@^3.1.0 but none was installed. npm WARN codelyzer@3.2.2 requires a peer of @angular/compiler@^2.3.1 || >=4.0.0-beta <5.0.0 but none was installed. npm WARN codelyzer@3.2.2 requires a peer of @angular/core@^2.3.1 || >=4.0.0-beta <5.0.0 but none was installed. npm WARN schema-utils@0.4.3 requires a peer of webpack@^2.0.0 || ^3.0.0 but none was installed. npm WARN ajv-keywords@2.1.1 requires a peer of ajv@^5.0.0 but none was installed.

C:\demo_tutorials\nativescript-sdk-examples-ng>tns run android Searching for devices... Executing before-liveSync hook from C:\demo_tutorials\nativescript-sdk-examples-ng\hooks\before-liveSync\nativescript-angular-sync.js Copying template files... Installing tns-android / Installing tns-android[ ...........] / loadRequestedDeps: verb afterAdd C:\Users\sendur\AppData \ Installing tns-android[ ..........] \ fetchMetadata: verb afterAdd C:\Users\sendur\AppData\Roanativescript-sdk-examples-ng@0.1.0 C:\demo_tutorials\nativescript-sdk-examples-ng +-- UNMET PEER DEPENDENCY @angular/compiler@6.0.1 +-- UNMET PEER DEPENDENCY @angular/core@6.0.1 +-- tns-android@4.1.0-2018.5.11.3 +-- UNMET PEER DEPENDENCY tns-core-modules@4.0.0-2018.5.13.5 `-- UNMET PEER DEPENDENCY webpack@4.5.0

Project successfully created. Executing before-prepare hook from C:\demo_tutorials\nativescript-sdk-examples-ng\hooks\before-prepare\nativescript-dev-typescript.js Found peer TypeScript 2.7.2 Preparing project... Executing before-prepareJSApp hook from C:\demo_tutorials\nativescript-sdk-examples-ng\hooks\before-prepareJSApp\nativescript-dev-webpack.js Unable to apply changes on device: emulator-5554. Error is: Unexpected token ). Executing after-watch hook from C:\demo_tutorials\nativescript-sdk-examples-ng\hooks\after-watch\nativescript-dev-typescript.js Executing after-watch hook from C:\demo_tutorials\nativescript-sdk-examples-ng\hooks\after-watch\nativescript-dev-webpack.js Unexpected token ) ..# run android

moorthi07 commented 6 years ago

tns should build with local version of angular . In this case , it looks like it is picking up ng 6.0 from global as opposed to 5.0 in the local.