0

I am a beginner in Angular 2. I am going through a Udemy course entitled "Learning Angular 2 by Building 12 Apps." I am facing issues with setting up Angular 2. I have done everything shown in the video entitled "Angular 2 Quickstart Setup Explanation." But when I type "npm start" in Git Bash, I am getting this error:

> [email protected] start C:\Users\Kanon\Desktop\exercise fies\learn angular by building apps\a2website
> tsc && concurrently "npm run tsc:w" "npm run lite"

node_modules/rxjs/Subject.d.ts(16,22): error TS2415: Class 'Subject<T>' incorrectly extends base class 'Observable<T>'.
  Types of property 'lift' are incompatible.
    Type '<T, R>(operator: Operator<T, R>) => Observable<T>' is not assignable t      o type '<R>(operator: Operator<T, R>) => Observable<R>'.
      Type 'Observable<T>' is not assignable to type 'Observable<R>'.
        Type 'T' is not assignable to type 'R'.
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! [email protected] start: `tsc && concurrently "npm run tsc:w" "npm run lite" `
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the [email protected] start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Kanon\AppData\Roaming\npm-cache\_logs\2018-01-31T14_25_27_937Z-debug.log

Here is the error log file:

0 info it worked if it ends with ok
1 verbose cli [ 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli   'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli   'start' ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle [email protected]~prestart: [email protected]
6 info lifecycle [email protected]~start: [email protected]
7 verbose lifecycle [email protected]~start: unsafe-perm in lifecycle true
8 verbose lifecycle [email protected]~start: PATH: C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;C:\Users\Kanon\Desktop\exercise fies\learn angular by building apps\a2website\node_modules\.bin;C:\Users\Kanon\bin;C:\Program Files\Git\mingw64\bin;C:\Program Files\Git\usr\local\bin;C:\Program Files\Git\usr\bin;C:\Program Files\Git\usr\bin;C:\Program Files\Git\mingw64\bin;C:\Program Files\Git\usr\bin;C:\Users\Kanon\bin;C:\ProgramData\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files (x86)\Brackets\command;C:\Program Files (x86)\Skype\Phone;C:\Program Files\MySQL\MySQL Utilities 1.6;C:\Program Files\nodejs;C:\ProgramData\chocolatey\bin;C:\Users\Kanon\AppData\Local\Programs\Python\Python36-32\Scripts;C:\Users\Kanon\AppData\Local\Programs\Python\Python36-32;C:\Users\Kanon\AppData\Local\Microsoft\WindowsApps;C:\Program Files\Microsoft VS Code\bin;C:\Program Files\Java\jdk1.8.0_144\bin;C:\Users\Kanon\AppData\Roaming\npm;C:\Program Files\erl9.2\bin;C:\Program Files\GTK2-bundle\bin;C:\Program Files\gettext-iconv\bin;C:\Program Files\Git\usr\bin\vendor_perl;C:\Program Files\Git\usr\bin\core_perl
9 verbose lifecycle [email protected]~start: CWD: C:\Users\Kanon\Desktop\exercise fies\learn angular by building apps\a2website
10 silly lifecycle [email protected]~start: Args: [ '/d /s /c',
10 silly lifecycle   'tsc && concurrently "npm run tsc:w" "npm run lite" ' ]
11 silly lifecycle [email protected]~start: Returned: code: 2  signal: null
12 info lifecycle [email protected]~start: Failed to exec start script
13 verbose stack Error: [email protected] start: `tsc && concurrently "npm run tsc:w" "npm run lite" `
13 verbose stack Exit status 2
13 verbose stack     at EventEmitter.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\index.js:285:16)
13 verbose stack     at emitTwo (events.js:126:13)
13 verbose stack     at EventEmitter.emit (events.js:214:7)
13 verbose stack     at ChildProcess.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
13 verbose stack     at emitTwo (events.js:126:13)
13 verbose stack     at ChildProcess.emit (events.js:214:7)
13 verbose stack     at maybeClose (internal/child_process.js:925:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
14 verbose pkgid [email protected]
15 verbose cwd C:\Users\Kanon\Desktop\exercise fies\learn angular by building apps\a2website
16 verbose Windows_NT 10.0.15063
17 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "start"
18 verbose node v8.9.4
19 verbose npm  v5.6.0
20 error code ELIFECYCLE
21 error errno 2
22 error [email protected] start: `tsc && concurrently "npm run tsc:w" "npm run lite" `
22 error Exit status 2
23 error Failed at the [email protected] start script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 2, true ]

You can find my project files here: https://drive.google.com/open?id=1BlxYt29j7QkGrAdR7Jovid34f5kwXaeE

Please, help me to find the solution. I cannot proceed further to the course until the issue is solved.

4
  • 1
    upgrade your angular versions to angular 4 and then upgrade rxjs to 5.4 Commented Jan 31, 2018 at 16:01
  • 1
    As the others have mentioned, your project is outdated. I'd highly recommended keeping your project at the latest, stable, major version (5+ as if now). If you're trying to use someone else's project you have chosen something that hasn't been maintained for a long time, and I'd suggest you either start from a fresh Angular CLI (5+) project or ensure the seed/boilerplate you use does Commented Jan 31, 2018 at 16:08
  • @Z.Bagley OK. I understand. As I am a beginner in Angular, should I go for a new course featuring Angular 5 and leaving the current Angular 2 course? Would you please suggest me a good video course on the latest version of Angular? Commented Jan 31, 2018 at 16:28
  • 1
    @john I don't use any video tutorials myself, prefer written blogs. I'd highly recommend at least running through the Angular - Tour of Heroes before you use any external guides if you're just starting. A few hours of reading and coding and you'll have a strong foundation, and know how to look for more specific vlogs to get the job done! Commented Jan 31, 2018 at 18:08

1 Answer 1

1

Just upgrade your Angular (5.2 already). Run: yarn add @angular/cli. Then, navigate to a directory and run ng new <project-name>

That's it, Angular is configured.

Also, I recommend going through Angular.io documentation and Getting started. It's good and informative.

Sign up to request clarification or add additional context in comments.

2 Comments

OK. I understand. As I am a beginner in Angular, should I go for a new course featuring Angular 5 and leaving the current Angular 2 course? If the answer is yes, would you please suggest me a good video course on the latest version of Angular?
Absolutely yes. As I said in my answer, you can read Angular's Quick Start: angular.io/guide/quickstart. It helped me a lot. If you mind paying, Pluralsight has lots of good courses.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.