You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ng update @angular/cli - Expected end of file #11825
Please post your .angular-cli.json file. I guess it’s possible that if this file is corrupt or in a state that the updater doesn’t recognize that it could throw this error.
I am even trying to run ng update @angular/cli --migrate-only, it runs without any errors, but angular.json file is not being created.
You need to run ng update @angular/cli --migrate-only --from=5.0.0 (or from the current version). If you don't mention the from argument, it might think that everything is up to date already.
@hansl
I did mention that and still, it won't work!
What I did for now, is generate a new app with the latest angular-cli, copy the angular.json file and brought in all the contents of the old .angular-cli.json file and it seems to work for now!
Hey @bhaidar, thanks for sharing the workaround. This seems like a problem with legacy configuration. Let's close the issue for now and revisit if it happens again. Please open a new ticket if this is still relevant.
Activity
bhaidar commentedon Aug 10, 2018
Anyone please?
alexeagle commentedon Aug 10, 2018
Did you look into the
angular.jsonfile? It's probably corrupted, is it easy to repair by hand?The repro steps are not sufficient since you need to have some older application state to trigger the error.
bhaidar commentedon Aug 10, 2018
Hello @alexeagle
I don't have yet the angular.json file. I am upgrading from angular 5 with .angular-cli.json file.
I did all the upgrade and ran
ng updateand I get that nothing needs to be updated anymore, all is good.However, angular.json file is not being created!
I am even trying to run
ng update @angular/cli --migrate-only, it runs without any errors, but angular.json file is not being created.Also, when I run
ng serverI get this error:Local workspace file ('angular.json') could not be found.cado1982 commentedon Aug 10, 2018
Please post your .angular-cli.json file. I guess it’s possible that if this file is corrupt or in a state that the updater doesn’t recognize that it could throw this error.
bhaidar commentedon Aug 11, 2018
Hi @cado1982
Here's a copy of my .angular-cli.json file. I just removed the
scriptsandstylesnot to paste a long content here.{ "$schema": "./node_modules/@angular/cli/lib/config/schema.json", "project": { "name": "client-app" }, "apps": [ { "root": "src", "outDir": "dist", "assets": [ "assets", "favicon.ico", "web.config" ], "index": "index.html", "main": "main.ts", "polyfills": "polyfills.ts", "test": "test.ts", "tsconfig": "tsconfig.app.json", "testTsconfig": "tsconfig.spec.json", "prefix": "app", "styles": [], "scripts": [], "environmentSource": "environments/environment.ts", "environments": { "dev": "environments/environment.ts", "hmr": "environments/environment.hmr.ts", "prod": "environments/environment.prod.ts" } } ], "e2e": { "protractor": { "config": "./protractor.conf.js" } }, "lint": [ { "project": "src/tsconfig.app.json", "exclude": "**/node_modules/**" }, { "project": "src/tsconfig.spec.json", "exclude": "**/node_modules/**" }, { "project": "e2e/tsconfig.e2e.json", "exclude": "**/node_modules/**" } ], "test": { "karma": { "config": "./karma.conf.js" } }, "defaults": { "styleExt": "scss", "component": {} } }hansl commentedon Aug 15, 2018
You need to run
ng update @angular/cli --migrate-only --from=5.0.0(or from the current version). If you don't mention the from argument, it might think that everything is up to date already.bhaidar commentedon Aug 16, 2018
@hansl
I did mention that and still, it won't work!
What I did for now, is generate a new app with the latest angular-cli, copy the angular.json file and brought in all the contents of the old .angular-cli.json file and it seems to work for now!
mgechev commentedon Aug 19, 2019
Hey @bhaidar, thanks for sharing the workaround. This seems like a problem with legacy configuration. Let's close the issue for now and revisit if it happens again. Please open a new ticket if this is still relevant.
angular-automatic-lock-bot commentedon Sep 19, 2019
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.