3

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.

2
  • Please, show us your: npm -version and node -version Commented Dec 2, 2016 at 1:54
  • The question is already answered. The problem was in angular-cli.json file where project was set up to use [email protected] Commented Dec 2, 2016 at 9:27

1 Answer 1

1

Check the project version in angular-cli.json or .angular-cli.json.

It should be something like:

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

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

3 Comments

Where do you find this if it's not in the root dir?
If you're using angular-cli, angular-cli.json will be in the root directory. The latest version of the cli looks for .angular-cli.json but either should work.
Awesome thanks, I can see it yeah. Didn't see it because it's a dotfile

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.