Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update: Data path ".from" should be string. #10312

Closed
Splaktar opened this issue Apr 13, 2018 · 12 comments · Fixed by #10315
Closed

update: Data path ".from" should be string. #10312

Splaktar opened this issue Apr 13, 2018 · 12 comments · Fixed by #10315
Assignees
Milestone

Comments

@Splaktar
Copy link
Member

Versions

Angular CLI: 6.0.0-rc.4
Node: 8.10.0
OS: darwin x64
Angular: 6.0.0-rc.4
... animations, cli, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, platform-server, router
... service-worker

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.5.5
@angular-devkit/build-angular     0.5.5
@angular-devkit/build-optimizer   0.5.5
@angular-devkit/core              0.5.5
@angular-devkit/schematics        0.5.6
@angular/cdk                      6.0.0-rc.2
@angular/flex-layout              5.0.0-beta.13
@angular/material                 6.0.0-rc.2
@ngtools/json-schema              1.1.0
@ngtools/webpack                  6.0.0-rc.3
@schematics/angular               0.5.6
@schematics/update                0.5.6
rxjs                              5.5.10
typescript                        2.7.2
webpack                           4.5.0

Repro steps

  • Step 1 - Install CLI rc.4 and see this message
================================================================================
An old CLI configuration has been detected, which needs to be updated to the latest version.

Please run the following command to update this workspace:
  ng update @angular/cli --migrate-only --from=1
================================================================================
  • Step 2 - Run ng update @angular/cli --migrate-only --from=1 as suggested and get this error
Schematic input does not validate against the Schema: {"dryRun":false,"migrateOnly":true,"from":1,"force":false,"all":false,"next":false,"registry":"http://registry.npmjs.org/"}
Errors:

  Data path ".from" should be string.
  • Step 3 - Run ng update @angular/cli --migrate-only --from="1" and get the same error
  • Step 4 - Run ng update @angular/cli --migrate-only --from='1' and get the same error

Desired behavior

The command recommended by the CLI message should run without error.

Mention any other details that might be useful (optional)

N/A

@pinalbhatt
Copy link

Me too getting same error.

@Splaktar
Copy link
Member Author

ng update @angular/cli --migrate-only --from=1.7.4 seemed to work, but it is not what was recommended. I was upgrading from Angular CLI 6.0.0-beta.5.

@dkaushikl
Copy link

ng update @angular/cli --migrate-only --from=1.7.4 not work

@benouat
Copy link

benouat commented Apr 13, 2018

The nodejs module used behind the scene to get command line parameters is probably wrongly casting --from=1 to boolean instead of keeping it as a string.

ng update @angular/cli --migrate-only --from=1.7.4 just worked for me

@nik-base
Copy link

Use your previous version of angular-cli instead of 1 for the --from attribute.
So it would look something like this.
ng update @angular/cli --migrate-only --from=<previous_version_of_cli>
The new angular cli doesnt have angular-cli.json, it is replaced by angular.json.

@filipesilva filipesilva added this to the v6.0.0 milestone Apr 13, 2018
@filipesilva
Copy link
Contributor

Yes it looks like our arg parsing isn't reading --from=1 as a number. There is a fix incoming in #10315. Sorry about that :/

@dkaushikl
Copy link

after above command, it generates a new error while build or serve application
Cannot read property 'config' of null

@mantonik
Copy link

Hi, as I understand fix is in new build, but what I should do now to move forward?

When I do
ng update @angular/cli --migrate-only
Updating package.json with dependency @angular/cli @ "1.7.4" (was "1.5.0")...

but ng server still is giving a problem-related cli version

I tried
[mariusz admin.angular5]$ ng update @angular/cli --migrate-only --from=1.5.0
/Users/mariusz/dev/selenium_testing_portal/projects/admin.angular5>
[mariusz admin.angular5]$ ng update @angular/cli --migrate-only --from="1.5.0"
/Users/mariusz/dev/selenium_testing_portal/projects/admin.angular5>

but those look like no effect

my current config

[mariusz admin.angular5]$ ng --version

 _                      _                 ____ _     ___
/ \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|

/ △ \ | '_ \ / | | | | |/ _ | '__| | | | | | |
/ ___ | | | | (
| | || | | (| | | | || | | |
// __| ||_, |_,||_,|| _|||
|___/

Angular CLI: 6.0.0-rc.4
Node: 8.11.1
OS: darwin x64
Angular: 5.2.9
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router

Package Version

@angular-devkit/architect 0.5.6 (cli-only)
@angular-devkit/core 0.5.6 (cli-only)
@angular-devkit/schematics 0.5.6 (cli-only)
@angular/cli
@schematics/angular 0.5.6 (cli-only)
@schematics/update 0.5.6 (cli-only)
rxjs 5.5.10
typescript 2.7.2 (cli-only)

Thank you for suggestion

@Splaktar
Copy link
Member Author

@mantonik I would try ng update @angular/cli --migrate-only --from=1.7.4 and if that doesn't work, try upgrading to 1.7.4, getting things working, and then re-running the update command with 6.0.0-rc.4.

@cyrilletuzi
Copy link
Contributor

cyrilletuzi commented Apr 16, 2018

@Brocco @filipesilva @hansl #10315 didn't correctly fixed this issue.

The option is not converting anymore into a boolean, but it's still converting into a number. So:

  • ng update @angular/cli --migrate-only --from=1.7.4 works

But following doesn't work:

  • ng update @angular/cli --migrate-only --from=1.7
  • ng update @angular/cli --migrate-only --from=1

And when updating the CLI, the CLI explicitly says to do the last option (from 1), so a lot of people will run into this issue.

@Brocco
Copy link
Contributor

Brocco commented Apr 16, 2018

The fix referenced (#10315) has not yet been released and because both 1 and 1.7 can both be parsed as numbers that is what is happening. The fix will respect the option's declared type and parse those values as strings even though they could be parsed as numbers.

Thanks for your vigilance in testing these issues.

@angular-automatic-lock-bot
Copy link

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.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 8, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants