I have travis-ci
integrated with my GitHub account (https://github.com/pradeep0601/Angular5-Router-App).
When I updated @angular/cli
version from 1.7.4 to 6.0.0-rc.3, the build started failing with an error:
Local workspace file ('angular.json') could not be found.
Error: Local workspace file ('angular.json') could not be found.
at WorkspaceLoader._getProjectWorkspaceFilePath (/home/travis/build/pradeep0601/Angular5-Router-App/node_modules/@angular/cli/models/workspace-loader.js:37:19)
at WorkspaceLoader.loadWorkspace (/home/travis/build/pradeep0601/Angular5-Router-App/node_modules/@angular/cli/models/workspace-loader.js:24:21)
at TestCommand._loadWorkspaceAndArchitect (/home/travis/build/pradeep0601/Angular5-Router-App/node_modules/@angular/cli/models/architect-command.js:177:32)
at TestCommand.<anonymous> (/home/travis/build/pradeep0601/Angular5-Router-App/node_modules/@angular/cli/models/architect-command.js:45:25)
at Generator.next (<anonymous>)
at /home/travis/build/pradeep0601/Angular5-Router-App/node_modules/@angular/cli/models/architect-command.js:7:71
at new Promise (<anonymous>)
at __awaiter (/home/travis/build/pradeep0601/Angular5-Router-App/node_modules/@angular/cli/models/architect-command.js:3:12)
at TestCommand.initialize (/home/travis/build/pradeep0601/Angular5-Router-App/node_modules/@angular/cli/models/architect-command.js:44:16)
at /home/travis/build/pradeep0601/Angular5-Router-App/node_modules/@angular/cli/models/command-runner.js:100:23
package.json snippet to better understand the running environment:
"@angular/cli": "6.0.0-rc.3",
"@angular/compiler-cli": "^5.2.0",
"@angular/language-service": "^5.2.0",
"@types/jasmine": "~2.8.3",
"@types/jasminewd2": "~2.0.2",
With recent version, without
--migrate-only
I got the repo updated.I did ng update
The Angular CLI configuration format has been changed, and your existing configuration can be updated automatically by running the following command:
I was getting the same error messages. It was a silly mistake on my end, I was not running
ng serve
in the directory where my Angular project is. Make sure you are in the correct directory (project directory) before running this command.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-
To update Angular Cli dev-
To fix audit issues after npm install:-
To fix the issue related to "angular.json" :-
Hoping this will help you :)
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"
Generate a new project and default application by running the following command:
It works for me:
Delete folder
node_modules
Run command:
npm install
( If it does not work for the first time, repeat this 2 or 3 times, Its funny but it works for me. )
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 runningnpm audit fix --dry-run -json
in the console. This will give you an idea of what the commandnpm audit fix
will do, in the form of json in the console.