Angular-cli: ng update: The specified command update is invalid.

Created on 26 Jan 2018  Â·  10Comments  Â·  Source: angular/angular-cli

what is current equivalent of ng update? because it does not work; I followed #4679 and got this message, another issue #4304 with the same problem was just closed with no explanation. can we please get some of that, explanation?

screen shot 2018-01-26 at 21 51 46

Most helpful comment

Wait, what? Since when has this been removed? The official update guide at https://update.angular.io/ stills shows it.

screen shot 2018-05-28 at 20 23 04

All 10 comments

from this
screen shot 2018-01-26 at 22 02 26
it looks like the command was removed 🤔 so how do we update the app now?

I don't see this command on official doc either, look like it was removed

There isn't such a command anymore, you can read more about this in https://github.com/angular/angular-cli/issues/4584.

For everyone else getting stuck here, the correct update command now seems to be: npm install --save-dev @angular/cli@latest

After issuing the npm install --save-dev @angular/cli@latest command I was presented with this:

npm WARN notice [SECURITY] ws has the following vulnerability: 1 high. Go here for more details: https://nodesecurity.io/advisories?search=ws&version=1.1.2 - Run `npm i npm@latest -g` to upgrade your npm version, and then `npm audit` to get more info.
npm WARN notice [SECURITY] sshpk has the following vulnerability: 1 high. Go here for more details: https://nodesecurity.io/advisories?search=sshpk&version=1.13.1 - Run `npm i npm@latest -g` to upgrade your npm version, and then `npm audit` to get more info.
npm WARN notice [SECURITY] stringstream has the following vulnerability: 1 moderate. Go here for more details: https://nodesecurity.io/advisories?search=stringstream&version=0.0.5 - Run `npm i npm@latest -g` to upgrade your npm version, and then `npm audit` to get more info.
npm WARN notice [SECURITY] debug has the following vulnerability: 1 low. Go here for more details: https://nodesecurity.io/advisories?search=debug&version=2.3.3 - Run `npm i npm@latest -g` to upgrade your npm version, and then `npm audit` to get more info.
npm WARN notice [SECURITY] debug has the following vulnerability: 1 low. Go here for more details: https://nodesecurity.io/advisories?search=debug&version=2.3.3 - Run `npm i npm@latest -g` to upgrade your npm version, and then `npm audit` to get more info.
npm WARN notice [SECURITY] debug has the following vulnerability: 1 low. Go here for more details: https://nodesecurity.io/advisories?search=debug&version=2.3.3 - Run `npm i npm@latest -g` to upgrade your npm version, and then `npm audit` to get more info.
npm WARN notice [SECURITY] debug has the following vulnerability: 1 low. Go here for more details: https://nodesecurity.io/advisories?search=debug&version=2.2.0 - Run `npm i npm@latest -g` to upgrade your npm version, and then `npm audit` to get more info.
npm WARN notice [SECURITY] randomatic has the following vulnerability: 1 low. Go here for more details: https://nodesecurity.io/advisories?search=randomatic&version=1.1.7 - Run `npm i npm@latest -g` to upgrade your npm version, and then `npm audit` to get more info.
npm WARN notice [SECURITY] parsejson has the following vulnerability: 1 high. Go here for more details: https://nodesecurity.io/advisories?search=parsejson&version=0.0.3 - Run `npm i npm@latest -g` to upgrade your npm version, and then `npm audit` to get more info.
npm WARN notice [SECURITY] https-proxy-agent has the following vulnerability: 1 high. Go here for more details: https://nodesecurity.io/advisories?search=https-proxy-agent&version=1.0.0 - Run `npm i npm@latest -g` to upgrade your npm version, and then `npm audit` to get more info.
npm WARN notice [SECURITY] lodash has the following vulnerability: 1 low. Go here for more details: https://nodesecurity.io/advisories?search=lodash&version=4.17.4 - Run `npm i npm@latest -g` to upgrade your npm version, and then `npm audit` to get more info.
npm WARN notice [SECURITY] lodash has the following vulnerability: 1 low. Go here for more details: https://nodesecurity.io/advisories?search=lodash&version=3.10.1 - Run `npm i npm@latest -g` to upgrade your npm version, and then `npm audit` to get more info.
npm WARN notice [SECURITY] hoek has the following vulnerability: 1 moderate. Go here for more details: https://nodesecurity.io/advisories?search=hoek&version=2.16.3 - Run `npm i npm@latest -g` to upgrade your npm version, and then `npm audit` to get more info.

> @angular/[email protected] postinstall C:\PlayGround\angular\sunshine\node_modules\@angular\cli
> node ./bin/ng-update-message.js


================================================================================
The Angular CLI configuration format has been changed, and your existing configuration can
be updated automatically by running the following command:

  ng update @angular/cli
================================================================================

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

+ @angular/[email protected]
added 614 packages in 44.183s

There is an ng update @angular/cli suggestion near the end.

running ng -v on my machine produces the following:

     _                      _                 ____ _     ___
    / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
   / â–³ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
  / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
 /_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
                |___/


Angular CLI: 6.0.5
Node: 8.11.1
OS: win32 x64
Angular:
...

Package                      Version
------------------------------------------------------
@angular-devkit/architect    0.6.5
@angular-devkit/core         0.6.5
@angular-devkit/schematics   0.6.5
@schematics/angular          0.6.5
@schematics/update           0.6.5
rxjs                         6.2.0
typescript                   2.7.2

Wait, what? Since when has this been removed? The official update guide at https://update.angular.io/ stills shows it.

screen shot 2018-05-28 at 20 23 04

Was getting the same error. So I then ran npm install --save-dev @angular/cli@latest

And after that, when I ran ng update @angular/cli, it automatically created angular.json, deleted .angular-cli.json and updated karma.conf.js, src/tsconfig.spec.json, package.json, and tslint.json

image

screen shot 2018-07-10 at 14 37 23
Still get command update is invalid :-(

Was following 'Angular Update Guide | 5.2 -> 6.1 for Medium Apps' on update.angular.io

had to update my node version to 10.9.0 after upgrading the CLI.
Screen Shot 2019-08-13 at 14 35 04

now I'm getting this error:

`=> ng update @angular/cli
Your global Angular CLI version (8.2.1) is greater than your local
version (1.6.7). The local Angular CLI version is used.

To disable this warning use "ng config -g cli.warnings.versionMismatch false".
The specified command update is invalid. For available options, see ng help.
`

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

_This action has been performed automatically by a bot._

Was this page helpful?
0 / 5 - 0 ratings