{"id":2071,"date":"2017-05-11T09:42:02","date_gmt":"2017-05-11T09:42:02","guid":{"rendered":"http:\/\/salientsoft.co.uk\/?p=2071"},"modified":"2018-10-10T17:15:57","modified_gmt":"2018-10-10T17:15:57","slug":"upgrading-angular-cli","status":"publish","type":"post","link":"https:\/\/salientsoft.co.uk\/?p=2071","title":{"rendered":"Upgrading angular-cli"},"content":{"rendered":"<p>Instructions as per <a href=\"https:\/\/github.com\/angular\/angular-cli#updating-angular-cli\">here<\/a>:-<\/p>\n<h3>Updating Angular CLI<\/h3>\n<p>If you&#8217;re using Angular CLI <code>beta.28<\/code> or less, you need to uninstall <code>angular-cli<\/code> package. It should be done due to changing of package&#8217;s name and scope from <code>angular-cli<\/code> to <code>@angular\/cli<\/code>:<\/p>\n<blockquote>\n<pre>npm uninstall -g angular-cli\r\nnpm uninstall --save-dev angular-cli<\/pre>\n<\/blockquote>\n<p>To update Angular CLI to a new version, you must update both the global package and your project&#8217;s local package.<\/p>\n<h4>Global package:<\/h4>\n<blockquote>\n<pre>npm uninstall -g @angular\/cli\r\nnpm cache clean\r\nnpm install -g @angular\/cli@latest<\/pre>\n<\/blockquote>\n<h4>Local project package:<\/h4>\n<blockquote>\n<pre>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\r\nnpm install --save-dev @angular\/cli@latest\r\nnpm install<\/pre>\n<\/blockquote>\n<p>Note that for a primeNg application I also had to reinstall the angular animations module:-<\/p>\n<blockquote>\n<pre>npm install @angular\/animations<\/pre>\n<\/blockquote>\n<p>Failing to do this caused numerous errors on an ng serve due to the inability to reference the animations(!) :-<\/p>\n<blockquote>\n<pre>ERROR in E:\/Dev\/angular\/places-admin\/node_modules\/@angular\/platform-browser\/animations\/src\/animation_renderer.d.ts (1,53):\r\nCannot find module '@angular\/animations\/browser'.\r\n\r\nERROR in E:\/Dev\/angular\/places-admin\/node_modules\/@angular\/platform-browser\/animations\/src\/providers.d.ts (8,276):\r\nCannot find module '@angular\/animations\/browser'.\r\n\r\nERROR in Error encountered resolving symbol values statically.\r\nCould not resolve @angular\/animations\/browser relative to\r\nE:\/Dev\/angular\/places-admin\/node_modules\/@angular\/platform-browser\/animations\/index.d.ts.,\r\nresolving symbol ?e in\r\nE:\/Dev\/angular\/places-admin\/node_modules\/@angular\/platform-browser\/animations\/index.d.ts,\r\nresolving symbol BrowserAnimationsModule in\r\nE:\/Dev\/angular\/places-admin\/node_modules\/@angular\/platform-browser\/animations\/index.d.ts,\r\nresolving symbol BrowserAnimationsModule in\r\nE:\/Dev\/angular\/places-admin\/node_modules\/@angular\/platform-browser\/animations\/index.d.ts\r\n\r\nERROR in .\/~\/@angular\/platform-browser\/@angular\/platform-browser\/animations.es5.js\r\n\r\nModule not found: Error:\r\nCan't resolve '@angular\/animations\/browser' in\r\n'E:\\Dev\\angular\\places-admin\\node_modules\\@angular\\platform-browser\\@angular\\platform-browser'\r\n@ .\/~\/@angular\/platform-browser\/@angular\/platform-browser\/animations.es5.js 13:0-249\r\n@ .\/src\/app\/app.module.ts\r\n@ .\/src\/main.ts\r\n@ multi webpack-dev-server\/client?\r\n<a href=\"http:\/\/localhost:4200\">http:\/\/localhost:4200<\/a> .\/src\/main.ts\r\n\r\nERROR in .\/~\/primeng\/components\/accordion\/accordion.js\r\nModule not found: Error:\r\nCan't resolve '@angular\/animations' in\r\n'E:\\Dev\\angular\\places-admin\\node_modules\\primeng\\components\\accordion'\r\n@ .\/~\/primeng\/components\/accordion\/accordion.js 13:19-49\r\n@ .\/~\/primeng\/primeng.js\r\n@ .\/src\/app\/app.module.ts\r\n@ .\/src\/main.ts\r\n@ multi webpack-dev-server\/client?\r\n<a href=\"http:\/\/localhost:4200\">http:\/\/localhost:4200<\/a> .\/src\/main.ts\r\n\r\nERROR in .\/~\/primeng\/components\/calendar\/calendar.js\r\nModule not found: Error:\r\nCan't resolve '@angular\/animations' in\r\n'E:\\Dev\\angular\\places-admin\\node_modules\\primeng\\components\\calendar'\r\n@ .\/~\/primeng\/components\/calendar\/calendar.js 13:19-49\r\n@ .\/~\/primeng\/primeng.js\r\n@ .\/src\/app\/app.module.ts\r\n@ .\/src\/main.ts\r\n@ multi webpack-dev-server\/client?\r\n<a href=\"http:\/\/localhost:4200\">http:\/\/localhost:4200<\/a> .\/src\/main.ts\r\n\r\nERROR in .\/~\/primeng\/components\/confirmdialog\/confirmdialog.js\r\nModule not found: Error:\r\nCan't resolve '@angular\/animations' in\r\n'E:\\Dev\\angular\\places-admin\\node_modules\\primeng\\components\\confirmdialog'\r\n@ .\/~\/primeng\/components\/confirmdialog\/confirmdialog.js 13:19-49\r\n@ .\/~\/primeng\/primeng.js\r\n@ .\/src\/app\/app.module.ts\r\n@ .\/src\/main.ts\r\n@ multi webpack-dev-server\/client?\r\n<a href=\"http:\/\/localhost:4200\">http:\/\/localhost:4200<\/a> .\/src\/main.ts<\/pre>\n<\/blockquote>\n<p>&nbsp;<br \/>\nIt appeared that I did not need to reinstall primeng via <em>npm install primeng \u2013save.<\/em> In fact although it initially ran without, I did reinstall this too as well as the animations.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Instructions as per here:- Updating Angular CLI If you&#8217;re using Angular CLI beta.28 or less, you need to uninstall angular-cli package. It should be done due to changing of package&#8217;s name and scope from angular-cli to @angular\/cli: npm uninstall -g angular-cli npm uninstall &#8211;save-dev angular-cli To update Angular CLI to a new version, you must [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[198],"tags":[16,15],"_links":{"self":[{"href":"https:\/\/salientsoft.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/2071"}],"collection":[{"href":"https:\/\/salientsoft.co.uk\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/salientsoft.co.uk\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/salientsoft.co.uk\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/salientsoft.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2071"}],"version-history":[{"count":10,"href":"https:\/\/salientsoft.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/2071\/revisions"}],"predecessor-version":[{"id":2087,"href":"https:\/\/salientsoft.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/2071\/revisions\/2087"}],"wp:attachment":[{"href":"https:\/\/salientsoft.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2071"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/salientsoft.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2071"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/salientsoft.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2071"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}