I have travis-ci
integrated with my GitHub account (https://github.com/pradeep0601/Angular5-Router-App).
When I updated @angular/cli
versio
I had the same problem and found that there was no package.json in my project (but only the package-lock.json). I then
..and all worked out fine. Took a while to figure it out, but that did it for me.
For me what worked was creating a new Angular project and just copied the angular.json file in the project that had a problem due to the fact that the angular.json file was missing.
Just check your directory, you must run "ng serve " on the same directory where you have created the project.
So, first enter in your project directory.
Uninstall the old version of Angular cli, and install Angular CLI global:
Update Angular cli global package to the next version, "@angular/compiler-cli": "^6.0.0"
npm uninstall -g @angular/cli
npm cache verify
npm install -g @angular/cli@next
Generate a new project and default application by running the following command:
ng new my-project
cd my-project
ng serve
Just run ng update @angular/cli
in your console.
You might find some vulnerabilities after running the command (if using npm), but then just runnpm audit fix
in the console to fix them. This command will scan the project for any vulnerabilities and it will also fix compatibility issues by installing updates to these dependencies. If you do not wish to auto fix these vulnerabilities immediately, you can perform a Dry Run: by running npm audit fix --dry-run -json
in the console. This will give you an idea of what the command npm audit fix
will do, in the form of json in the console.
Well, I faced the same issue as soon as I updated my angular cli
version.
Earlier I was using 1.7.4 and just now I upgraded it to angular cli 6.0.8
.
To update Angular Cli global:
npm uninstall -g angular-cli
npm cache clean
npm install -g @angular/cli@latest
To update Angular Cli dev:
npm uninstall --save-dev angular-cli
npm install --save-dev @angular/cli@latest
npm install
To fix audit issues after npm install:
npm audit fix
To fix the issue related to "angular.json":
ng update @angular/cli --migrate-only --from=1.7.4