Skip to content

ng g input.mergeMap is not a function #8782

Closed

Description

@dottodot

ng g app-shell works on a fresh app but on my project I get the following error but no idea what it means

TypeError: input.mergeMap is not a function
    at Object.callRule (/node_modules/@angular-devkit/schematics/src/rules/call.js:70:18)
    at SchematicImpl.call (/node_modules/@angular-devkit/schematics/src/engine/schematic.js:35:23)
    at Promise (/node_modules/@angular/cli/tasks/schematic-run.js:73:23)
    at new Promise (<anonymous>)
    at Class.run (/node_modules/@angular/cli/tasks/schematic-run.js:72:16)
    at Class.run (/node_modules/@angular/cli/commands/generate.js:152:33)
    at resolve (/node_modules/@angular/cli/ember-cli/lib/models/command.js:261:20)
    at new Promise (<anonymous>)
    at Class.validateAndRun (/node_modules/@angular/cli/ember-cli/lib/models/command.js:240:12)
    at Promise.resolve.then.then (/node_modules/@angular/cli/ember-cli/lib/cli/cli.js:140:24)

The only thing I can think of is it's a multi app setup structured like

src
  -- client
      -- app
  -- admin
      -- app
  -- environments

but I've tried setting the root and get the same result

ng generate app-shell [ --universal-app universal --root src/client ]

Activity

  1. the-ult commented on Dec 7, 2017

    @the-ult

    Same happens with ng g component [componentname] or ng g module [modulename]

    ng generate module public-library/trial
    input.mergeMap is not a function
    TypeError: input.mergeMap is not a function
        at Object.callRule (/mnt/d/dev/bereslim/bsm-ui/node_modules/@angular-devkit/schematics/src/rules/call.js:70:18)
        at SchematicImpl.call (/mnt/d/dev/bereslim/bsm-ui/node_modules/@angular-devkit/schematics/src/engine/schematic.js:35:23)
        at Promise (/mnt/d/dev/bereslim/bsm-ui/node_modules/@angular/cli/tasks/schematic-run.js:73:23)
        at new Promise (<anonymous>)
        at Class.run (/mnt/d/dev/bereslim/bsm-ui/node_modules/@angular/cli/tasks/schematic-run.js:72:16)
        at Class.run (/mnt/d/dev/bereslim/bsm-ui/node_modules/@angular/cli/commands/generate.js:152:33)
        at resolve (/mnt/d/dev/bereslim/bsm-ui/node_modules/@angular/cli/ember-cli/lib/models/command.js:261:20)
        at new Promise (<anonymous>)
        at Class.validateAndRun (/mnt/d/dev/bereslim/bsm-ui/node_modules/@angular/cli/ember-cli/lib/models/command.js:240:12)
        at Promise.resolve.then.then (/mnt/d/dev/bereslim/bsm-ui/node_modules/@angular/cli/ember-cli/lib/cli/cli.js:140:24)
    ng --version
    
        _                      _                 ____ _     ___
       / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
      / △ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
     / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
    /_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
                   |___/
        
    Angular CLI: 1.6.0
    Node: 8.7.0
    OS: linux x64
    Angular: 5.1.0
    ... animations, common, compiler, compiler-cli, core, forms
    ... language-service, platform-browser, platform-browser-dynamic
    ... platform-server, router
    
    @angular/cdk: 5.0.0
    @angular/cli: 1.6.0
    @angular/flex-layout: 2.0.0-beta.10-4905443
    @angular/material-moment-adapter: 5.0.0
    @angular/material: 5.0.0
    @angular-devkit/build-optimizer: 0.0.35
    @angular-devkit/core: 0.0.22
    @angular-devkit/schematics: 0.0.41
    @ngtools/json-schema: 1.1.0
    @ngtools/webpack: 1.9.0
    @schematics/angular: 0.1.10
    typescript: 2.5.3
    webpack: 3.10.0

    yarn install

    warning @schematics/angular@0.1.10" has incorrect peer dependency "@angular-devkit/schematics@0.0.40".
    warning "@schematics/schematics@0.0.10" has incorrect peer dependency "@angular-devkit/schematics@0.0.40".
  2. dottodot commented on Dec 7, 2017

    @dottodot
    Author

    Ok so deleting node_modules and reinstalling seems to clear that error but faced with a new error of

    Error: Specified module does not exist
    Specified module does not exist
    
  3. njifares commented on Dec 7, 2017

    @njifares

    Same issue here after updating CLI from 1.5.2 to 1.6.0

  4. cristianqr commented on Dec 7, 2017

    @cristianqr

    The same is happening with:
    ng generate module module-name

    I think the issue is with all commands of angular cli.

  5. self-assigned this
    on Dec 7, 2017
  6. added
    P1
    on Dec 7, 2017
  7. Brocco commented on Dec 7, 2017

    @Brocco
    Contributor

    If you are receiving an error other than Specified module does not exist please create a new issue with your error and steps to recreate.

  8. NilsNaegele commented on Dec 7, 2017

    @NilsNaegele

    exact same issue:
    input.mergeMap is not a function
    TypeError: input.mergeMap is not a function
    at Object.callRule (/home/nils/Documents/DEV2017A/angular5-heroes/node_modules/@angular-devkit/schematics/src/rules/call.js:70:18)
    at SchematicImpl.call (/home/nils/Documents/DEV2017A/angular5-heroes/node_modules/@angular-devkit/schematics/src/engine/schematic.js:35:23)
    at Promise (/home/nils/Documents/DEV2017A/angular5-heroes/node_modules/@angular/cli/tasks/schematic-run.js:73:23)
    at Promise ()
    at Class.run (/home/nils/Documents/DEV2017A/angular5-heroes/node_modules/@angular/cli/tasks/schematic-run.js:72:16)
    at Class.run (/home/nils/Documents/DEV2017A/angular5-heroes/node_modules/@angular/cli/commands/generate.js:152:33)
    at resolve (/home/nils/Documents/DEV2017A/angular5-heroes/node_modules/@angular/cli/ember-cli/lib/models/command.js:261:20)
    at Promise ()
    at Class.validateAndRun (/home/nils/Documents/DEV2017A/angular5-heroes/node_modules/@angular/cli/ember-cli/lib/models/command.js:240:12)
    at Promise.resolve.then.then (/home/nils/Documents/DEV2017A/angular5-heroes/node_modules/@angular/cli/ember-cli/lib/cli/cli.js:140:24)

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

    Angular CLI: 1.6.0
    Node: 8.3.0
    OS: linux x64
    Angular: 5.1.0
    ... animations, common, compiler, compiler-cli, core, forms
    ... http, platform-browser, platform-browser-dynamic
    ... platform-server, router

    @angular/cli: 1.6.0
    @angular/language-service: 4.4.6
    @angular-devkit/build-optimizer: 0.0.35
    @angular-devkit/core: 0.0.22
    @angular-devkit/schematics: 0.0.41
    @ngtools/json-schema: 1.1.0
    @ngtools/webpack: 1.9.0
    @schematics/angular: 0.1.10
    @schematics/schematics: 0.0.10
    typescript: 2.4.2
    webpack: 3.10.0

  9. joseques commented on Dec 7, 2017

    @joseques

    It seems that if you have @angular/cli installed globally and a different version installed locally it gets broken.
    I solved the same error removing the cli package that was installed locally with npm remove @angular/cli --save in my project folder.

  10. bingika commented on Dec 8, 2017

    @bingika

    same error Your global Angular CLI version (1.6.0) is greater than your local
    version (1.4.9). The local Angular CLI version is used.

    To disable this warning use "ng set --global warnings.versionMismatch=false".
    input.mergeMap is not a function
    TypeError: input.mergeMap is not a function

  11. the-ult commented on Dec 8, 2017

    @the-ult

    It seems that if you have @angular/cli installed globally and a different version installed locally it gets broken.
    I solved the same error removing the cli package that was installed locally with npm remove @angular/cli --save in my project folder.

    Both my global and local version are the same.

    But.... uninstalling the local (project) cli works. 👍

    [edit]
    The other way around => uninstall global and install local project CLI results in the same error.
    So it seems to be a problem with the local (project) cli

  12. oldlie commented on Dec 8, 2017

    @oldlie

    Removing local @angular/cli can resolve this issue, but globally CLI can't add automatically the references to the related local ts files.

  13. 19 remaining items

  14. belemlc commented on Dec 22, 2017

    @belemlc

    rm package-lock.json
    npm install @angular-devkit/schematics@0.0.34 --save-dev

    worked for me!

  15. sanjaynegi commented on Dec 24, 2017

    @sanjaynegi

    npm i @angular-devkit/schematics@0.0.40

    npm install --save-dev @angular/cli@latest

    running these two worked for me..

  16. oldlie commented on Dec 25, 2017

    @oldlie

    把项目的angular版本更新到5.0.0可以彻底解决这个问题。

  17. added a commit that references this issue on Dec 29, 2017
  18. simeyla commented on Jan 1, 2018

    @simeyla

    Can someone explain WHY npm install @angular-devkit/schematics@0.0.34 --save-dev fixes it?

    And also why schematics isn't in my package.json file after running this - yes it does work?

  19. simeyla commented on Jan 1, 2018

    @simeyla

    CLI isn't compatible with typescript 2.6 or above - so run this.

    npm install typescript@'>=2.4.2 <2.6.0

    Changing schematics worked for me too but then I get another error saying it needed 0.0.42. So I installed 0.0.42 and then typescript 2.5 and it worked again

  20. salmankazmi commented on Jan 4, 2018

    @salmankazmi

    @joseques Thanks. uninstalling the local angular CLI worked.

  21. balajidharma commented on Jan 6, 2018

    @balajidharma

    installed latest one and working fine

    npm install @angular-devkit/schematics --save-dev

  22. bolajipemipo commented on Jan 9, 2018

    @bolajipemipo

    @BenevidesLecontes got You seem to not be depending on "@angular/core. This is an error.' after successfully creating a component. This was after I ran npm install @angular-devkit/schematics --save-dev

  23. mohammedshoib commented on Mar 22, 2018

    @mohammedshoib

    I too had the same problem, it worked after I removed cli from the local project.

    npm remove @angular/cli --save

  24. filipesilva commented on Oct 8, 2019

    @filipesilva
    Contributor

    Thanks for reporting this issue. This issue was originally reported a long time ago and since then we've had many releases, one of which might have addressed this problem. Please update to the most recent Angular CLI version.

    If the problem persists after upgrading, please open a new issue, provide a simple repository reproducing the problem, and describe the difference between the expected and current behavior.

  25. angular-automatic-lock-bot commented on Nov 8, 2019

    @angular-automatic-lock-bot

    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.

  26. locked and limited conversation to collaborators on Nov 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1severity3: broken

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions