Skip to content

bug: ng g c SomeComponent fails with "Invalid rule result: Function()." #11754

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

Closed
catull opened this issue Aug 2, 2018 · 6 comments
Closed

Comments

@catull
Copy link
Contributor

catull commented Aug 2, 2018

Bug Report

- [x] bug report
- [ ] feature request

Command (mark with an x)

- [ ] new
- [ ] build
- [ ] serve
- [ ] test
- [ ] e2e
- [x] generate
- [ ] add
- [ ] update
- [ ] lint
- [ ] xi18n
- [ ] run
- [ ] config
- [ ] help
- [ ] version
- [ ] doc

Versions

node: 10.8.0
npm: 6.2.0 or 6.3.0
ng: 6.0.4
ng CLI: 6.0.8 or 6.1.2
OS: linux x64_86 (Linux Mint 19 or 18)

Due to a hard limitation, I cannot upgrade from Angular 6.0.4 for the time being.

Repro steps

ng g c SomeComponent

The log given by the failure

The CLI tool returns unsuccessfully with:

Invalid rule result: Function().

Desired functionality

Would like to generate a new component with the CLI tool, not manually.

Was able to create a new component with NG CLI 6.0.4.

Mention any other details that might be useful

n/a

@catull
Copy link
Contributor Author

catull commented Aug 2, 2018

I also get this behaviour with node versions 10.6.0 and 10.7.0.
Same bad luck with node 8.11.3 (LTS).

@catull
Copy link
Contributor Author

catull commented Aug 2, 2018

Found a "dirty" work-around.

ng update @angular/cli # to 6.1.2
ng update @angular/core # to 6.1.0

Then

ng generate component PublicationSearch

It produced the component files, then I flashed back the changes in package.json.
Job done.

@filipesilva
Copy link
Contributor

I think this is related, but not quite a duplicate of #11663.

@nitinprajapati1404
Copy link

nitinprajapati1404 commented Feb 25, 2019

this error comes because of the version mismatch of your project and your system so use following command to execute

ng g c SomeComponent --version=6.0.8

where 6.0.8 is the version of angular of my project

@catull
Copy link
Contributor Author

catull commented Feb 26, 2019

@nitinprajapati1404 Perhaps that is also the case.

However, in case I was unclear, it was not the case for me.
I had the exact same version in /usr/local and in my project's workspace, when I looked into the bug in August 2018.

I switched to and from the versions, kept them at the same version meticulously.

The problem has not manifested for a long while now.

Thus I close it now.

@catull catull closed this as completed Feb 26, 2019
@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 9, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants