NativeScript / sample-ng-todomvc

Angular2 + NativeScript TodoMVC example
Apache License 2.0
115 stars 30 forks source link

tns run android error after clone #18

Closed liudonghua123 closed 7 years ago

liudonghua123 commented 7 years ago

I excuted the following command

git clone https://github.com/NativeScript/sample-ng-todomvc
cd sample-ng-todomvc
tns run android

Then the following errors appeared, I tried to remove node_modules,hooks,platforms directory and rerun, but the same problem.

D:\code\nativescript\sample-ng-todomvc>tns run android

> nativescript-angular@1.5.2 postinstall D:\code\nativescript\sample-ng-todomvc\node_modules\nativescript-angular
> node postinstall.js

                                                                                                                                                                             > nativescript-dev-typescript@0.3.7 postinstall D:\code\nativescript\sample-ng-todomvc\node_modules\nativescript-dev-typescript                                              > node postinstall.js                                                                                                                                                                                                                                                                                                                                     Project already targets TypeScript ~2.2.1
todomvc@2.2.0 D:\code\nativescript\sample-ng-todomvc                                                                                                                         +-- @angular/common@4.0.3
+-- @angular/compiler@4.0.3
+-- @angular/core@4.0.3
+-- @angular/forms@4.0.3
+-- @angular/http@4.0.3
+-- @angular/platform-browser@4.0.3
+-- @angular/platform-browser-dynamic@4.0.3
+-- @angular/router@4.0.3
+-- babel-traverse@6.8.0
| +-- babel-code-frame@6.22.0                                                                                                                                                | | +-- chalk@1.1.3
| | | +-- ansi-styles@2.2.1
| | | +-- escape-string-regexp@1.0.5
| | | +-- has-ansi@2.0.0                                                                                                                                                     | | | | `-- ansi-regex@2.1.1
| | | +-- strip-ansi@3.0.1
| | | `-- supports-color@2.0.0
| | `-- js-tokens@3.0.1
| +-- babel-messages@6.23.0
| +-- babel-runtime@6.23.0
| | +-- core-js@2.4.1                                                                                                                                                        | | `-- regenerator-runtime@0.10.5
| +-- debug@2.6.6
| | `-- ms@0.7.3
| +-- globals@8.18.0
| +-- invariant@2.2.2
| | `-- loose-envify@1.3.1
| +-- lodash@3.10.1                                                                                                                                                          | `-- repeating@1.1.3
|   `-- is-finite@1.0.2
|     `-- number-is-nan@1.0.1
+-- babel-types@6.8.1
| +-- esutils@2.0.2
| `-- to-fast-properties@1.0.3
+-- babylon@6.8.0
+-- lazy@1.0.11
+-- nativescript-angular@1.5.2
| +-- punycode@1.3.2
| +-- querystring@0.2.0
| `-- url@0.10.3
+-- nativescript-dev-typescript@0.3.7                                                                                                                                        | `-- nativescript-hook@0.2.1
|   +-- glob@6.0.4                                                                                                                                                           |   | +-- inflight@1.0.6                                                                                                                                                     |   | | `-- wrappy@1.0.2                                                                                                                                                     |   | +-- inherits@2.0.3                                                                                                                                                     |   | +-- minimatch@3.0.3                                                                                                                                                    |   | | `-- brace-expansion@1.1.7                                                                                                                                            |   | |   +-- balanced-match@0.4.2                                                                                                                                           |   | |   `-- concat-map@0.0.1                                                                                                                                               |   | +-- once@1.4.0                                                                                                                                                         |   | `-- path-is-absolute@1.0.1                                                                                                                                             |   `-- mkdirp@0.5.1                                                                                                                                                         |     `-- minimist@0.0.8                                                                                                                                                     +-- nativescript-intl@0.0.10                                                                                                                                                 +-- reflect-metadata@0.1.10                                                                                                                                                  +-- rxjs@5.3.1                                                                                                                                                               | `-- symbol-observable@1.0.4                                                                                                                                                +-- tns-core-modules@2.5.2                                                                                                                                                   | `-- tns-core-modules-widgets@2.5.0                                                                                                                                         +-- typescript@2.2.2                                                                                                                                                         `-- zone.js@0.8.10
npm WARN todomvc@2.2.0 license should be a valid SPDX license expression
Copying template files...
Installing  tns-android
todomvc@2.2.0 D:\code\nativescript\sample-ng-todomvc
`-- tns-android@2.5.0

  | Installing tns-android
Project successfully created.
Executing before-prepare hook from D:\code\nativescript\sample-ng-todomvc\hooks\before-prepare\nativescript-dev-typescript.js
Found peer TypeScript 2.2.2
node_modules/tns-core-modules/declarations.d.ts(3,15): error TS2300: Duplicate identifier 'Request'.

node_modules/tns-core-modules/declarations.d.ts(17,5): error TS2403: Subsequent variable declarations must have the same type.  Variable 'headers' must be of type 'any', but here has type 'string[] | Headers | { [index: string]: string; }'.
node_modules/tns-core-modules/declarations.d.ts(19,5): error TS2403: Subsequent variable declarations must have the same type.  Variable 'mode' must be of type 'string', but here has type 'RequestMode'.
node_modules/tns-core-modules/declarations.d.ts(20,5): error TS2403: Subsequent variable declarations must have the same type.  Variable 'credentials' must be of type 'string', but here has type 'RequestCredentials'.
node_modules/tns-core-modules/declarations.d.ts(21,5): error TS2403: Subsequent variable declarations must have the same type.  Variable 'cache' must be of type 'string', but here has type 'RequestCache'.

node_modules/tns-core-modules/declarations.d.ts(36,15): error TS2300: Duplicate identifier 'Headers'.
node_modules/tns-core-modules/declarations.d.ts(46,5): error TS2687: All declarations of 'bodyUsed' must have identical modifiers.
node_modules/tns-core-modules/declarations.d.ts(56,15): error TS2300: Duplicate identifier 'Response'.
node_modules/tns-core-modules/declarations.d.ts(72,5): error TS2687: All declarations of 'status' must have identical modifiers.
node_modules/tns-core-modules/declarations.d.ts(73,5): error TS2687: All declarations of 'statusText' must have identical modifiers.
node_modules/tns-core-modules/declarations.d.ts(74,5): error TS2403: Subsequent variable declarations must have the same type.  Variable 'headers' must be of type 'any', but here has type 'HeaderInit'.
node_modules/tns-core-modules/declarations.d.ts(74,5): error TS2687: All declarations of 'headers' must have identical modifiers.
node_modules/tns-core-modules/declarations.d.ts(78,14): error TS2300: Duplicate identifier 'BodyInit'.
node_modules/tns-core-modules/declarations.d.ts(79,14): error TS2300: Duplicate identifier 'RequestInfo'.
node_modules/tns-core-modules/es-collections.d.ts(15,5): error TS2687: All declarations of 'size' must have identical modifiers.
node_modules/tns-core-modules/es-collections.d.ts(19,13): error TS2403: Subsequent variable declarations must have the same type.  Variable 'Map' must be of type 'MapConstructor', but here has type '{ new <K, V>(): Map<K, V>; new <K, V>(m: Map<K, V>): Map<K, V>; new <K, V>(l: List<any>): Map<K, ...'.

node_modules/tns-core-modules/es-collections.d.ts(30,14): error TS2300: Duplicate identifier 'MapConstructor'.
node_modules/tns-core-modules/es-collections.d.ts(31,14): error TS2300: Duplicate identifier 'SetConstructor'.
node_modules/tns-core-modules/es-collections.d.ts(39,5): error TS2687: All declarations of 'size' must have identical modifiers.
node_modules/tns-core-modules/es-collections.d.ts(41,13): error TS2403: Subsequent variable declarations must have the same type.  Variable 'Set' must be of type 'SetConstructor', but here has type '{ new <T>(): Set<T>; new <T>(s: Set<T>): Set<T>; new <T>(l: List<T>): Set<T>; prototype: Set<any>...'.
node_modules/tns-core-modules/es-collections.d.ts(54,5): error TS2687: All declarations of 'value' must have identical modifiers.
node_modules/tns-core-modules/es6-promise.d.ts(98,5): error TS2687: All declarations of 'prototype' must have identical modifiers.
node_modules/tns-core-modules/es6.d.ts(7,5): error TS2687: All declarations of 'prototype' must have identical modifiers.
node_modules/tns-core-modules/es6.d.ts(9,5): error TS2687: All declarations of 'iterator' must have identical modifiers.
node_modules/tns-core-modules/weakmap.d.ts(3,11): error TS2428: All declarations of 'WeakMap' must have identical type parameters.
node_modules/tns-core-modules/weakmap.d.ts(11,13): error TS2403: Subsequent variable declarations must have the same type.  Variable 'WeakMap' must be of type 'WeakMapConstructor', but here has type 'new <K, V>() => WeakMap<K, V>'.
node_modules/tns-core-modules/weakmap.d.ts(12,27): error TS2344: Type 'K' does not satisfy the constraint 'object'.

node_modules/typescript/lib/lib.dom.d.ts(1104,5): error TS2687: All declarations of 'status' must have identical modifiers.

node_modules/typescript/lib/lib.dom.d.ts(1105,5): error TS2687: All declarations of 'statusText' must have identical modifiers.
node_modules/typescript/lib/lib.dom.d.ts(1106,5): error TS2687: All declarations of 'headers' must have identical modifiers.
node_modules/typescript/lib/lib.dom.d.ts(6945,11): error TS2300: Duplicate identifier 'Headers'.
node_modules/typescript/lib/lib.dom.d.ts(6954,13): error TS2300: Duplicate identifier 'Headers'.
node_modules/typescript/lib/lib.dom.d.ts(9343,11): error TS2300: Duplicate identifier 'Request'.
node_modules/typescript/lib/lib.dom.d.ts(9360,13): error TS2300: Duplicate identifier 'Request'.
node_modules/typescript/lib/lib.dom.d.ts(9365,11): error TS2300: Duplicate identifier 'Response'.
node_modules/typescript/lib/lib.dom.d.ts(9376,13): error TS2300: Duplicate identifier 'Response'.
node_modules/typescript/lib/lib.dom.d.ts(13491,14): error TS2687: All declarations of 'bodyUsed' must have identical modifiers.
node_modules/typescript/lib/lib.dom.d.ts(14898,6): error TS2300: Duplicate identifier 'BodyInit'.
node_modules/typescript/lib/lib.dom.d.ts(14929,6): error TS2300: Duplicate identifier 'RequestInfo'.
node_modules/typescript/lib/lib.es2015.collection.d.ts(28,14): error TS2687: All declarations of 'size' must have identical modifiers.
node_modules/typescript/lib/lib.es2015.collection.d.ts(31,11): error TS2300: Duplicate identifier 'MapConstructor'.
node_modules/typescript/lib/lib.es2015.collection.d.ts(65,14): error TS2687: All declarations of 'size' must have identical modifiers.
node_modules/typescript/lib/lib.es2015.collection.d.ts(68,11): error TS2300: Duplicate identifier 'SetConstructor'.
node_modules/typescript/lib/lib.es2015.iterable.d.ts(28,14): error TS2687: All declarations of 'iterator' must have identical modifiers.
node_modules/typescript/lib/lib.es2015.iterable.d.ts(33,5): error TS2687: All declarations of 'value' must have identical modifiers.
node_modules/typescript/lib/lib.es2015.iterable.d.ts(118,11): error TS2300: Duplicate identifier 'MapConstructor'.
node_modules/typescript/lib/lib.es2015.iterable.d.ts(135,11): error TS2300: Duplicate identifier 'SetConstructor'.
node_modules/typescript/lib/lib.es2015.promise.d.ts(26,14): error TS2687: All declarations of 'prototype' must have identical modifiers.
node_modules/typescript/lib/lib.es2015.symbol.d.ts(33,14): error TS2687: All declarations of 'prototype' must have identical modifiers.

TypeScript compiler failed with exit code 1

D:\code\nativescript\sample-ng-todomvc>
vakrilov commented 7 years ago

Hey @liudonghua123 This sample is not updated and in fact we are planning to remove it. You can check nativescript-sdk-examples-ng which contains a much more extensive set of examples.