Posted under Angular
Permalink
Tags Tip, Tutorial
Instructions as per here:-
Updating Angular CLI
If you’re using Angular CLI beta.28
or less, you need to uninstall angular-cli
package. It should be done due to changing of package’s name and scope from angular-cli
to @angular/cli
:
npm uninstall -g angular-cli npm uninstall --save-dev angular-cli
To update Angular CLI to a new version, you must update both the global package and your project’s local package.
Global package:
npm uninstall -g @angular/cli npm cache clean npm install -g @angular/cli@latest
Local project package:
rm -rf node_modules dist # use rmdir /S/Q node_modules dist in Windows Command Prompt; use rm -r -fo node_modules,dist in Windows PowerShell npm install --save-dev @angular/cli@latest npm install
Note that for a primeNg application I also had to reinstall the angular animations module:-
npm install @angular/animations
Failing to do this caused numerous errors on an ng serve due to the inability to reference the animations(!) :-
ERROR in E:/Dev/angular/places-admin/node_modules/@angular/platform-browser/animations/src/animation_renderer.d.ts (1,53): Cannot find module '@angular/animations/browser'. ERROR in E:/Dev/angular/places-admin/node_modules/@angular/platform-browser/animations/src/providers.d.ts (8,276): Cannot find module '@angular/animations/browser'. ERROR in Error encountered resolving symbol values statically. Could not resolve @angular/animations/browser relative to E:/Dev/angular/places-admin/node_modules/@angular/platform-browser/animations/index.d.ts., resolving symbol ?e in E:/Dev/angular/places-admin/node_modules/@angular/platform-browser/animations/index.d.ts, resolving symbol BrowserAnimationsModule in E:/Dev/angular/places-admin/node_modules/@angular/platform-browser/animations/index.d.ts, resolving symbol BrowserAnimationsModule in E:/Dev/angular/places-admin/node_modules/@angular/platform-browser/animations/index.d.ts ERROR in ./~/@angular/platform-browser/@angular/platform-browser/animations.es5.js Module not found: Error: Can't resolve '@angular/animations/browser' in 'E:\Dev\angular\places-admin\node_modules\@angular\platform-browser\@angular\platform-browser' @ ./~/@angular/platform-browser/@angular/platform-browser/animations.es5.js 13:0-249 @ ./src/app/app.module.ts @ ./src/main.ts @ multi webpack-dev-server/client? http://localhost:4200 ./src/main.ts ERROR in ./~/primeng/components/accordion/accordion.js Module not found: Error: Can't resolve '@angular/animations' in 'E:\Dev\angular\places-admin\node_modules\primeng\components\accordion' @ ./~/primeng/components/accordion/accordion.js 13:19-49 @ ./~/primeng/primeng.js @ ./src/app/app.module.ts @ ./src/main.ts @ multi webpack-dev-server/client? http://localhost:4200 ./src/main.ts ERROR in ./~/primeng/components/calendar/calendar.js Module not found: Error: Can't resolve '@angular/animations' in 'E:\Dev\angular\places-admin\node_modules\primeng\components\calendar' @ ./~/primeng/components/calendar/calendar.js 13:19-49 @ ./~/primeng/primeng.js @ ./src/app/app.module.ts @ ./src/main.ts @ multi webpack-dev-server/client? http://localhost:4200 ./src/main.ts ERROR in ./~/primeng/components/confirmdialog/confirmdialog.js Module not found: Error: Can't resolve '@angular/animations' in 'E:\Dev\angular\places-admin\node_modules\primeng\components\confirmdialog' @ ./~/primeng/components/confirmdialog/confirmdialog.js 13:19-49 @ ./~/primeng/primeng.js @ ./src/app/app.module.ts @ ./src/main.ts @ multi webpack-dev-server/client? http://localhost:4200 ./src/main.ts
It appeared that I did not need to reinstall primeng via npm install primeng –save. In fact although it initially ran without, I did reinstall this too as well as the animations.