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 what I did that works for me was:
Inside package.json file, update the Angular CLI version to my desired one:
"devDependencies": { ...
"@angular/cli": "^6.0.8",
...
}
Delete the node_modules
folder, in order to clean the project before update the dependencies with:
npm install
ng update @angular/cli
Try to build again my project (the last and successful attempt)
ng build --prod
For me, the issue was that I have an angular project folder inside a rails project folder, and I ran all the angular update commands in the rails parent folder rather than the actual angular folder.
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. )
For me the problem was because of global @angular/cli version and @angular/compiler-cli were different. Look into package.json.
...
"@angular/cli": "6.0.0-rc.3",
"@angular/compiler-cli": "^5.2.0",
...
And if they don’t match, update or downgrade one of them.
~/Desktop $ ng serve
Local workspace file ('angular.json') could not be found.
Error: Local workspace file ('angular.json') could not be found.
at WorkspaceLoader._getProjectWorkspaceFilePath (/usr/lib/node_modules/@angular/cli/models/workspace-loader.js:37:19)
at WorkspaceLoader.loadWorkspace (/usr/lib/node_modules/@angular/cli/models/workspace-loader.js:24:21)
at ServeCommand._loadWorkspaceAndArchitect (/usr/lib/node_modules/@angular/cli/models/architect-command.js:180:32)
at ServeCommand.<anonymous> (/usr/lib/node_modules/@angular/cli/models/architect-command.js:47:25)
at Generator.next (<anonymous>)
at /usr/lib/node_modules/@angular/cli/models/architect-command.js:7:71
at new Promise (<anonymous>)
at __awaiter (/usr/lib/node_modules/@angular/cli/models/architect-command.js:3:12)
at ServeCommand.initialize (/usr/lib/node_modules/@angular/cli/models/architect-command.js:46:16)
at Object.<anonymous> (/usr/lib/node_modules/@angular/cli/models/command-runner.js:87:23)
This is because I haven't choose the Angular project directory.
It should be like:
~/Desktop/angularproject $ ng serve