I'm attempting to get Angular CLI working for an existing (fairly large) Angular 2 project. I started by following the CLI Quickstart, and got the Hello World project running.
After that I've been trying to copy my existing project into the CLI project and get it building. After fixing a lot of errors, I'm left with just one when I execute the "ng serve" or "ng build" commands:
Cannot read property 'getSourceFile' of undefined
I found this GitHub thread that suggested replacing WebPack's _resolve() function in
node_modules@ngtools\webpack\src\compiler_host.js
I replaced that in both my local NPM's Angular-CLI AND in the global one: [user]\AppData\Roaming\npm\node_modules\@angular\cli\node_modules\@ngtools\webpack\src\compiler_host.js
I still get the error.
I notice that the version of WebPack here is 1.3.0, whereas the current one available in NPM is 1.4.1. It also says that my globally installed Angular CLI is "1.0.0" whereas the latest in NPM shows up as 1.0.0-beta-28.3
Can anyone explain if 1.0.0 is the latest, or 1.0.0-beta-28.3? Why does 1.0.0 not show up in NPM at all, but it seems to be installed on my computer?
And most importantly, any ideas how to resolve this error?
angular-clihas been renamed@angular/cli, you should try install it bynpm install -g @angular/cli@latest, and see its version info bynpm view @angular/cli versionorng -v.