johnpapa / angular-tour-of-heroes

Angular - Tour of Heroes - The Next Step after Getting Started
Apache License 2.0
825 stars 1.44k forks source link

Not able to run npm run start-aot #117

Closed dgpuranik closed 7 years ago

dgpuranik commented 7 years ago

I just downloaded the app. I ran npm start successfully. I tried to execute npm run start-iot unsuccessfully. node version : 6.10.1 NPM version : 4.4.4

I have also installed angular-cli. I received the following error:

bash-3.2$ sudo npm run start-aot

angular-tour-of-heroes@0.1.0 start-aot /Users/darshan/work/dev/learning/angular-tour-of-heroes-master npm run aot && npm run rollup && gulp copy-aot && npm run lite

angular-tour-of-heroes@0.1.0 aot /Users/darshan/work/dev/learning/angular-tour-of-heroes-master ngc -p tsconfig-aot.json

sh: ngc: command not found npm ERR! file sh npm ERR! code ELIFECYCLE npm ERR! errno ENOENT npm ERR! syscall spawn npm ERR! angular-tour-of-heroes@0.1.0 aot: ngc -p tsconfig-aot.json npm ERR! spawn ENOENT npm ERR! npm ERR! Failed at the angular-tour-of-heroes@0.1.0 aot script 'ngc -p tsconfig-aot.json'. npm ERR! Make sure you have the latest version of node.js and npm installed. npm ERR! If you do, this is most likely a problem with the angular-tour-of-heroes package, npm ERR! not with npm itself. npm ERR! Tell the author that this fails on your system: npm ERR! ngc -p tsconfig-aot.json npm ERR! You can get information on how to open an issue for this project with: npm ERR! npm bugs angular-tour-of-heroes npm ERR! Or if that isn't available, you can get their info via: npm ERR! npm owner ls angular-tour-of-heroes npm ERR! There is likely additional logging output above.

npm ERR! A complete log of this run can be found in: npm ERR! /Users/darshan/.npm/_logs/2017-04-03T09_07_28_115Z-debug.log npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! angular-tour-of-heroes@0.1.0 start-aot: npm run aot && npm run rollup && gulp copy-aot && npm run lite npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the angular-tour-of-heroes@0.1.0 start-aot script 'npm run aot && npm run rollup && gulp copy-aot && npm run lite'. npm ERR! Make sure you have the latest version of node.js and npm installed. npm ERR! If you do, this is most likely a problem with the angular-tour-of-heroes package, npm ERR! not with npm itself. npm ERR! Tell the author that this fails on your system: npm ERR! npm run aot && npm run rollup && gulp copy-aot && npm run lite npm ERR! You can get information on how to open an issue for this project with: npm ERR! npm bugs angular-tour-of-heroes npm ERR! Or if that isn't available, you can get their info via: npm ERR! npm owner ls angular-tour-of-heroes npm ERR! There is likely additional logging output above.

npm ERR! A complete log of this run can be found in: npm ERR! /Users/darshan/.npm/_logs/2017-04-03T09_07_28_141Z-debug.log

gravidThoughts commented 7 years ago

I have the same exact issue. 'ngc' is not recognized as an internal or external command

I am assuming that this is the angular compiler, and it fails because the necessary infrastructure exists on John's machine, but has not been distributed to this repository.

gravidThoughts commented 7 years ago

Per instruction here I installed the necessary NPM packages to get ngc. Unfortunately it still does not work. Here is the npm-debug.log

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   'run',
1 verbose cli   'start-aot' ]
2 info using npm@3.10.10
3 info using node@v6.10.0
4 verbose run-script [ 'prestart-aot', 'start-aot', 'poststart-aot' ]
5 info lifecycle angular-tour-of-heroes@0.1.0~prestart-aot: angular-tour-of-heroes@0.1.0
6 silly lifecycle angular-tour-of-heroes@0.1.0~prestart-aot: no script for prestart-aot, continuing
7 info lifecycle angular-tour-of-heroes@0.1.0~start-aot: angular-tour-of-heroes@0.1.0
8 verbose lifecycle angular-tour-of-heroes@0.1.0~start-aot: unsafe-perm in lifecycle true
9 verbose lifecycle angular-tour-of-heroes@0.1.0~start-aot: PATH: C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin;D:\Angular Sample Applications\Tour of Heroes\John Papa's Version with Aot\node_modules\.bin;C:\Users\mcopeland\AppData\Roaming\npm;C:\Program Files\nodejs\;C:\Program Files (x86)\EMC IRM\Common\;D:\oracle\product\12.1.0\client_1\bin;C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;c:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files\Microsoft SQL Server\120\Tools\Binn\;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\110\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\120\Tools\Binn\;C:\Program Files\Microsoft SQL Server\120\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\120\Tools\Binn\ManagementStudio\;C:\Program Files (x86)\Microsoft SQL Server\120\DTS\Binn\;C:\Program Files (x86)\Microsoft Team Foundation Server 2015 Power Tools\;C:\Program Files (x86)\Skype\Phone\;C:\Program Files (x86)\AMD\ATI.ACE\Core-Static;C:\Program Files\Microsoft SQL Server\110\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\110\Tools\Binn\;C:\Program Files\Microsoft SQL Server\110\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\110\Tools\Binn\ManagementStudio\;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\PrivateAssemblies\;C:\Program Files (x86)\Microsoft SQL Server\110\DTS\Binn\;C:\Program Files (x86)\Windows Kits\10\Debuggers\x64;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;C:\Program Files (x86)\Microsoft Emulator Manager\1.0\;C:\Program Files (x86)\Windows Kits\10\Debuggers\x64\srcsrv;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit\;C:\Program Files\Microsoft\Web Platform Installer\;C:\Program Files (x86)\Sybase\Shared\PowerBuilder\;C:\Program Files\nodejs\;C:\Program Files\Git\cmd;C:\ProgramData\chocolatey\bin;C:\Program Files\dotnet\;C:\Program Files (x86)\Sybase\Shared\PowerBuilder\;C:\Users\mcopeland\AppData\Local\Microsoft\WindowsApps;;C:\Program Files (x86)\Microsoft VS Code\bin;C:\Users\mcopeland\AppData\Roaming\npm;C:\tools\cmder;
10 verbose lifecycle angular-tour-of-heroes@0.1.0~start-aot: CWD: D:\Angular Sample Applications\Tour of Heroes\John Papa's Version with Aot
11 silly lifecycle angular-tour-of-heroes@0.1.0~start-aot: Args: [ '/d /s /c',
11 silly lifecycle   'npm run aot && npm run rollup && gulp copy-aot && npm run lite' ]
12 silly lifecycle angular-tour-of-heroes@0.1.0~start-aot: Returned: code: 1  signal: null
13 info lifecycle angular-tour-of-heroes@0.1.0~start-aot: Failed to exec start-aot script
14 verbose stack Error: angular-tour-of-heroes@0.1.0 start-aot: `npm run aot && npm run rollup && gulp copy-aot && npm run lite`
14 verbose stack Exit status 1
14 verbose stack     at EventEmitter.<anonymous> (C:\Program Files\nodejs\node_modules\npm\lib\utils\lifecycle.js:255:16)
14 verbose stack     at emitTwo (events.js:106:13)
14 verbose stack     at EventEmitter.emit (events.js:191:7)
14 verbose stack     at ChildProcess.<anonymous> (C:\Program Files\nodejs\node_modules\npm\lib\utils\spawn.js:40:14)
14 verbose stack     at emitTwo (events.js:106:13)
14 verbose stack     at ChildProcess.emit (events.js:191:7)
14 verbose stack     at maybeClose (internal/child_process.js:877:16)
14 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
15 verbose pkgid angular-tour-of-heroes@0.1.0
16 verbose cwd D:\Angular Sample Applications\Tour of Heroes\John Papa's Version with Aot
17 error Windows_NT 10.0.14393
18 error argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "start-aot"
19 error node v6.10.0
20 error npm  v3.10.10
21 error code ELIFECYCLE
22 error angular-tour-of-heroes@0.1.0 start-aot: `npm run aot && npm run rollup && gulp copy-aot && npm run lite`
22 error Exit status 1
23 error Failed at the angular-tour-of-heroes@0.1.0 start-aot script 'npm run aot && npm run rollup && gulp copy-aot && npm run lite'.
23 error Make sure you have the latest version of node.js and npm installed.
23 error If you do, this is most likely a problem with the angular-tour-of-heroes package,
23 error not with npm itself.
23 error Tell the author that this fails on your system:
23 error     npm run aot && npm run rollup && gulp copy-aot && npm run lite
23 error You can get information on how to open an issue for this project with:
23 error     npm bugs angular-tour-of-heroes
23 error Or if that isn't available, you can get their info via:
23 error     npm owner ls angular-tour-of-heroes
23 error There is likely additional logging output above.
24 verbose exit [ 1, true ]

Here is the npm cli output. npm ERR! Failed at the angular-tour-of-heroes@0.1.0 aot script 'ngc -p tsconfig-aot.json'.

Here is the output when I run that command line against ngc directly.

D:\Angular Sample Applications\Tour of Heroes\John Papa's Version with Aot\node_modules\.bin>ngc -p ..\..\tsconfig-aot.json
Error at D:/Angular Sample Applications/Tour of Heroes/John Papa's Version with Aot/node_modules/@angular/core/src/di/reflective_provider.d.ts:87:123: Cannot find name 'Map'.
Error at D:/Angular Sample Applications/Tour of Heroes/John Papa's Version with Aot/node_modules/@angular/core/src/di/reflective_provider.d.ts:87:165: Cannot find name 'Map'.
Error at D:/Angular Sample Applications/Tour of Heroes/John Papa's Version with Aot/node_modules/rxjs/Observable.d.ts:69:60: 'Promise' only refers to a type, but is being used as a value here.
Error at D:/Angular Sample Applications/Tour of Heroes/John Papa's Version with Aot/node_modules/@angular/core/src/change_detection/differs/iterable_differs.d.ts:15:48: Cannot find name 'Iterable'.
Error at D:/Angular Sample Applications/Tour of Heroes/John Papa's Version with Aot/node_modules/@angular/core/src/change_detection/differs/keyvalue_differs.d.ts:23:18: Cannot find name 'Map'.
Error at D:/Angular Sample Applications/Tour of Heroes/John Papa's Version with Aot/node_modules/@angular/core/src/change_detection/differs/default_keyvalue_differ.d.ts:24:16: Cannot find name 'Map'.
Error at D:/Angular Sample Applications/Tour of Heroes/John Papa's Version with Aot/node_modules/@angular/core/src/change_detection/differs/default_keyvalue_differ.d.ts:32:16: Cannot find name 'Map'.
Error at D:/Angular Sample Applications/Tour of Heroes/John Papa's Version with Aot/node_modules/@angular/platform-browser/src/dom/dom_adapter.d.ts:97:42: Cannot find name 'Map'.
Error at D:/Angular Sample Applications/Tour of Heroes/John Papa's Version with Aot/node_modules/@angular/platform-browser/src/browser/browser_adapter.d.ts:79:33: Cannot find name 'Map'.
Error at D:/Angular Sample Applications/Tour of Heroes/John Papa's Version with Aot/node_modules/@angular/common/src/directives/ng_class.d.ts:48:34: Cannot find name 'Set'.
Error at D:/Angular Sample Applications/Tour of Heroes/John Papa's Version with Aot/node_modules/@angular/platform-browser/src/dom/shared_styles_host.d.ts:11:30: Cannot find name 'Set'.
Error at D:/Angular Sample Applications/Tour of Heroes/John Papa's Version with Aot/node_modules/@angular/platform-browser/src/dom/shared_styles_host.d.ts:22:30: Cannot find name 'Set'.
Error at D:/Angular Sample Applications/Tour of Heroes/John Papa's Version with Aot/node_modules/@angular/http/src/headers.d.ts:52:59: Cannot find name 'Map'.
Error at D:/Angular Sample Applications/Tour of Heroes/John Papa's Version with Aot/node_modules/@angular/http/src/url_search_params.d.ts:46:16: Cannot find name 'Map'.
Error at D:/Angular Sample Applications/Tour of Heroes/John Papa's Version with Aot/app/app.component.ts:4:13: Cannot find name 'module'.
Error at D:/Angular Sample Applications/Tour of Heroes/John Papa's Version with Aot/node_modules/rxjs/operator/toPromise.d.ts:3:79: 'Promise' only refers to a type, but is being used as a value here.
Error at D:/Angular Sample Applications/Tour of Heroes/John Papa's Version with Aot/app/hero.service.ts:26:30: Property 'find' does not exist on type 'Hero[]'.
Error at D:/Angular Sample Applications/Tour of Heroes/John Papa's Version with Aot/app/hero.service.ts:26:35: Parameter 'hero' implicitly has an 'any' type.
Error at D:/Angular Sample Applications/Tour of Heroes/John Papa's Version with Aot/app/hero.service.ts:77:12: 'Promise' only refers to a type, but is being used as a value here.
Error at D:/Angular Sample Applications/Tour of Heroes/John Papa's Version with Aot/app/dashboard.component.ts:8:13: Cannot find name 'module'.
Error at D:/Angular Sample Applications/Tour of Heroes/John Papa's Version with Aot/app/heroes.component.ts:8:13: Cannot find name 'module'.
Error at D:/Angular Sample Applications/Tour of Heroes/John Papa's Version with Aot/app/hero-detail.component.ts:8:13: Cannot find name 'module'.
Error at D:/Angular Sample Applications/Tour of Heroes/John Papa's Version with Aot/app/hero-search.component.ts:16:13: Cannot find name 'module'.

I am starting to question my decision in choosing Angular. Incredibly brittle. This repository likely only works on John's machine. Good luck finding out why.

gravidThoughts commented 7 years ago

@dgpuranik I would suggest you do the AOT Quickstart recipe located here in Angular.io . I just tried it and it works. Far simpler project structure and then maybe you can revisit this repository and see if you can make it work with your new knowledge.

johnpapa commented 7 years ago

closing since this was rewritten with the CLI