0

according the guide from stackoverflow this post link i tried to upgrade my angular 5 project to 6 but when i do ng update @angular/cli i get error "no elements in sequence" with no other information how can i fix it? also i cant start my project anymore it say Local workspace file ('angular.json') could not be found.

this is my package.json also: i tried use "rxjs": "^5.5.4" or pathMatch: 'full' to my routers but didnt work for me

{
  "name": "m4user",
  "version": "0.0.0",
  "license": "MIT",
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build --prod",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e"
  },
  "private": true,
  "dependencies": {
    "@angular-devkit/schematics": "0.0.45",
    "@angular/animations": "^5.2.3",
    "@angular/cdk": "^5.2.4",
    "@angular/common": "^5.2.0",
    "@angular/compiler": "^5.2.0",
    "@angular/core": "^5.2.0",
    "@angular/flex-layout": "^5.0.0-beta.14",
    "@angular/forms": "^5.2.0",
    "@angular/http": "^5.2.0",
    "@angular/material": "^5.2.0",
    "@angular/platform-browser": "^5.2.0",
    "@angular/platform-browser-dynamic": "^5.2.0",
    "@angular/router": "^5.2.0",
    "@auth0/angular-jwt": "^1.1.0",
    "@ecodev/fab-speed-dial": "0.0.4",
    "@floydspace/ngx-validation": "^1.0.3",
    "@mdi/font": "^2.2.43",
    "@types/moment": "^2.13.0",
    "@types/raphael": "^2.1.30",
    "angular-captcha": "^3.0.6",
    "angular-typing-animation": "^0.5.4",
    "angularx-social-login": "^1.1.8",
    "chart.js": "^2.7.2",
    "core-js": "^2.4.1",
    "driver": "^1.0.0",
    "driver.js": "^0.3.8",
    "file-saver": "latest",
    "font-awesome": "^4.7.0",
    "hammerjs": "^2.0.8",
    "jquery": "^3.3.1",
    "jwt-decode": "^2.2.0",
    "materialize-css": "^0.100.2",
    "mdi": "^2.2.43",
    "ngx-contextmenu": "^4.1.2",
    "ngx-cookie-service": "^1.0.10",
    "ngx-uploader": "^4.2.2",
    "plyr": "^3.0.3",
    "raphael": "^2.2.7",
    "recordrtc": "^5.4.6",
    "roughjs": "^2.0.1",
    "rxjs": "5.5.4",
    "save": "^2.3.2",
    "sweetalert2": "^7.15.0",
    "videogular2": "^6.0.6",
    "zone.js": "^0.8.19"
  },
  "devDependencies": {
    "@angular/cli": "^6.0.1",
    "@angular/compiler-cli": "^5.2.0",
    "@angular/language-service": "^5.2.0",
    "@types/chartjs": "^0.0.31",
    "@types/core-js": "^0.9.46",
    "@types/jasmine": "~2.8.3",
    "@types/jasminewd2": "~2.0.2",
    "@types/jwt-decode": "^2.2.1",
    "@types/node": "~6.0.60",
    "codelyzer": "^4.0.1",
    "jasmine-core": "~2.8.0",
    "jasmine-spec-reporter": "~4.2.1",
    "karma": "~2.0.0",
    "karma-chrome-launcher": "~2.2.0",
    "karma-coverage-istanbul-reporter": "^1.2.1",
    "karma-jasmine": "~1.1.0",
    "karma-jasmine-html-reporter": "^0.2.2",
    "ngx-validators": "^3.0.0",
    "persian-date": "^1.0.5",
    "protractor": "~5.1.2",
    "ts-node": "~4.1.0",
    "tslint": "~5.9.1",
    "typescript": ">=2.4.2 <2.7.0"
  }
}
jicke
  • 83
  • 1
  • 2
  • 8

2 Answers2

2

This error happens when using RxJS 5.5.4 with angular (version 4/5), so just skip RxJS 5.5.4, and use RxJS 5.5.4 by adding "rxjs": "^5.5." to your project package.json. Also use this may be helpful

 npm i -g rxjs-tslint
rxjs-5-to-6-migrate -p [path/to/tsconfig.json]
Rajan Desai
  • 79
  • 1
  • 11
  • thanks for answer id did `npm i -g rxjs-tslint` but i dont know what is ` rxjs-5-to-6-migrate ` because i dont have this command in terminal – jicke May 11 '18 at 06:21
  • @Rajan Desai This package is all about upgrading rxjs packages not for the angular upgrade. Your solutions would be great if user only need to rxjs upgrade. – Srinivasan K K May 11 '18 at 06:27
2

Before doing ng update @angular/cli, You just need to upgrade your @angular/cli package to latest version.

 > npm uninstall -g @angular/cli 

 > npm install -g @angular/cli ( if throws an error then run npm cache clean --f & try again this command)

Then delete node_modules folder.

  • Create one new angular v6 project

  • Compare package.json from new project with your existing project

  • Update the package version in package.json

  • Then run npm update, ng build --prod sequentially

  • You might face errors with Rxjs, If you don't want to update any existing code then install rxjs/compat package

npm install --save rxjs/compat

Now finally you will need to replace your angular-cli.json file with angular.json file. Run ng update @angular/cli. Check your configuration settings in angular.json file.

That's it.

You can always refer https://update.angular.io/

Srinivasan K K
  • 418
  • 4
  • 10