angular-cli shows error saying the version is old

Question!

I was working on one of my projects which is in Angular 2. I'm using the [email protected] tool for building, testing, etc. I've recieved an error today when I was going to run and test the app.

It seems like you're using a project generated using an old version of the Angular CLI. The latest CLI now uses webpack and includes a lot of improvements, include a simpler workflow, a faster build and smaller bundles.

To get more info, including a step-by-step guide to upgrade the CLI, follow this link: https://github.com/angular/angular-cli/wiki/Upgrading-from-Beta.10-to-Beta.12

I was able to use the tool yesterday while I was building the app and I've done nothing unusual with it. I'm always running the cmd with admin rights and I've got angular-cli installed globally.

Thing I realized is a bit suspicious is that it shows me the 'old-version' error, while the version installed in my computer is the latest one (1.0.0-beta.15). I've checked the package.json file for som errors, but found nothing suspicious.

Here si the code if someone wants to have a look. Thanks in advance.

{
  "name": "oliwka-blog-final",
  "version": "1.0.0",
  "license": "MIT",
  "angular-cli": {},
  "scripts": {
    "start": "ng serve",
    "lint": "tslint \"src/**/*.ts\"",
    "test": "ng test",
    "pree2e": "webdriver-manager update",
    "e2e": "protractor"
  },
  "private": true,
  "dependencies": {
    "@angular/common": "2.0.0",
    "@angular/compiler": "2.0.0",
    "@angular/core": "2.0.0",
    "@angular/forms": "2.0.0",
    "@angular/http": "2.0.0",
    "@angular/platform-browser": "2.0.0",
    "@angular/platform-browser-dynamic": "2.0.0",
    "@angular/router": "3.0.0"
    "core-js": "^2.4.1",
    "ng2-imageupload": "^1.2.0",
    "ng2-img-cropper": "^0.6.4",
    "rxjs": "5.0.0-beta.12",
    "ts-helpers": "^1.1.1",
    "zone.js": "^0.6.23"
  },
  "devDependencies": {
    "@types/jasmine": "^2.2.30",,
    "angular-cli": "^1.0.0-beta.15",
    "codelyzer": "~0.0.26",
    "jasmine-core": "2.4.1",
    "jasmine-spec-reporter": "2.5.0",
    "karma": "1.2.0",
    "karma-chrome-launcher": "^2.0.0",
    "karma-cli": "^1.0.1",
    "karma-jasmine": "^1.0.2",
    "karma-remap-istanbul": "^0.2.1",
    "protractor": "4.0.5",
    "ts-node": "1.2.1",
    "tslint": "3.13.0",
    "typescript": "2.0.2"
  }
}

UPDATE

I've tried these steps:

  1. reinstalling it globally
  2. reinstalling it locally
  3. cleaning npm cache
  4. install it as dev-dependency

Also forgot to mention, that the tool works fine in other directories.



Answers

Check the project version in angular-cli.json.

It should be something like:

... "project": { "version": "1.0.0-beta.15", "name": "client" } ...

By : shusson


try something like this.

You need the variable accessible in both functions so it needs to be declared outside those functions and then defined inside the first one and use clearInterval() to cancel an existing interval

var timer;
$('#name').mouseenter(function() {
   timer = setInterval(mosaic, 150);
}).mouseleave(function() {
    clearInterval(timer);
});


This video can help you solving your question :)
By: admin