4

I believe the problem is related to updating angular 2. My actual sequence of events that led to this error was 1. installing ng2-typeahead, 2. getting errors and realizing I needed to install FormsModule, 3. getting more errors and npm updating everything. The line of code that errors in /node_modules/@angular/common/bundles/common.umd.js:3481:36) is

/**
 * @stable
 */
var /** @type {?} */ VERSION = new _angular_core.Version('2.3.0');

NPM debug log at npm-debug.log at pastebin.

dcoli
  • 183
  • 1
  • 1
  • 14
  • 1
    I think thats a conflict between angularcli@1.0.0-beta.22-1 and angular@2.3.0. Try to rollback your dependencies to angular-cli@1.0.0-beta.21 and angular@2.2.4, also, the typescript sould be 2.0.3+. – Bruno João Dec 09 '16 at 16:47
  • I'm not using Angular-cli, I don't believe, but SystemJS. Whatever the QuickStart uses. – dcoli Dec 09 '16 at 17:08
  • I do't know what is the exactly cause of the problem, but I had it last day and I've solved rolling back the dependencies. May be it help you! Tell us if it does so. – Bruno João Dec 09 '16 at 17:11

3 Answers3

1

There is a conflict between angularcli@1.0.0-beta.22-1 and angular@2.3.0. Try to rollback your dependencies to angular-cli@1.0.0-beta.21 and angular@2.2.4, also, the typescript sould be 2.0.3+.

https://github.com/angular/angular/issues/13342

Bruno João
  • 5,105
  • 2
  • 21
  • 26
  • After about two hours of install hell I reverted to an old copy and reinstalled typeahead. Then everything worked. Thanks for the advice. – dcoli Dec 09 '16 at 22:09
  • 1
    I had the same issue, in my case it was 'http@2.3.1' that was causing the issue. The rest of my packages where at version `@2.1.2`. I downgraded to `http@2.2.4` and it solved the issue. – Aaron C Dec 19 '16 at 17:30
  • Looking at this again, because now that I've moved to a new workstation it's happening again, and I don't (and didn't) have the angularcli installed. I'm attempting to create the Version class in angular/core that it's looking for, but I think it's actually a quite complex file that indicates what features are available. – dcoli Feb 21 '17 at 18:24
  • If I could just find the old source for this I think I'd be good. Currently using angular/core 2.1.0. – dcoli Feb 21 '17 at 18:36
  • Remove all angular-cli versions and run ng --version after that t see if was all removed. After that, I encourage you to upgrade your angular versions to the latest and change from `angular-cli` to `@angular/cli` that is the latest package for the cli. The last versions does not have this problems and you need to be sure you removed all old versions to avoid multiple ng versions conflicts. – Bruno João Feb 21 '17 at 19:54
  • Thanks again, but I don't use Angular CLI. Searching the entire codebase for angular-cli finds nothing, and running ng --version in my git bash client tells me "ng" is not found. Maybe it's a different module with the same problem? – dcoli Feb 22 '17 at 01:51
  • I found that my compile process uses npm-cli. – dcoli Feb 22 '17 at 02:28
  • Aha. I reread your posts and saw that you recommended upgrading angular as well. Learned that package.json can be tweaked to always upgrade past a minimum level (^), and doing that and running npm update --save fixed it. Thanks so much for your time. – dcoli Feb 22 '17 at 15:16
0

try: npm update --save and you'll have the latest versions automatically

moshe beeri
  • 2,007
  • 1
  • 17
  • 25
0

For me it was installed a new(er) version of angular by npm install -g, but forgot to change all the dependencies in the package.json. So the node_modules folder had lots of dependencies that were installed differently in the global installation. I removed that and applied the new dependencies. After that it worked.

Janos Vinceller
  • 1,208
  • 11
  • 25