angular-cli icon indicating copy to clipboard operation
angular-cli copied to clipboard

ng g input.mergeMap is not a function

Open dottodot opened this issue 8 years ago • 41 comments

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 ]

dottodot avatar Dec 07 '17 10:12 dottodot

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/[email protected]" has incorrect peer dependency "@angular-devkit/[email protected]".
warning "@schematics/[email protected]" has incorrect peer dependency "@angular-devkit/[email protected]".

the-ult avatar Dec 07 '17 10:12 the-ult

facing the same issue.

ng g c temp-component Your global Angular CLI version (1.5.0) is greater than your local version (1.4.3). 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 at Object.callRule

$ ng --version Your global Angular CLI version (1.5.0) is greater than your local version (1.4.3). The local Angular CLI version is used.

To disable this warning use "ng set --global warnings.versionMismatch=false". _ _ ____ _ ___ / \ _ __ __ _ _ | | __ _ _ __ / | | | | / △ \ | ' \ / _ | | | | |/ _ | '| | | | | | | / ___ | | | | (| | || | | (| | | | || | | | // __| ||_, |_,||_,|| _||| |___/ @angular/cli: 1.4.3 (e) node: 6.11.4 os: win32 x64 @angular/animations: 4.4.3 @angular/common: 4.4.3 @angular/compiler: 4.4.3 @angular/core: 4.4.3 @angular/forms: 4.4.3 @angular/http: 4.4.3 @angular/platform-browser: 4.4.3 @angular/platform-browser-dynamic: 4.4.3 @angular/router: 4.4.3 @angular/cli: 1.4.3 @angular/compiler-cli: 4.4.3 typescript: 2.5.2

ghost avatar Dec 07 '17 11:12 ghost

upgraded below packages and it started working again.'

ghost avatar Dec 07 '17 11:12 ghost

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

dottodot avatar Dec 07 '17 12:12 dottodot

Same issue here after updating CLI from 1.5.2 to 1.6.0

njifares avatar Dec 07 '17 12:12 njifares

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

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

cristianqr avatar Dec 07 '17 13:12 cristianqr

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.

Brocco avatar Dec 07 '17 19:12 Brocco

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

NilsNaegele avatar Dec 07 '17 21:12 NilsNaegele

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.

joseques avatar Dec 07 '17 23:12 joseques

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

bingika avatar Dec 08 '17 07:12 bingika

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

the-ult avatar Dec 08 '17 08:12 the-ult

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

oldlie avatar Dec 08 '17 08:12 oldlie

Same issue here, removing the local cli doesn't really sound like a solution

Vaelor avatar Dec 08 '17 11:12 Vaelor

I was able to fix installing this locally @angular-devkit/[email protected]

BenevidesLecontes avatar Dec 08 '17 12:12 BenevidesLecontes

I'm getting the same error after upgrading to latest angular-cli

boston99green avatar Dec 08 '17 19:12 boston99green

resolved after deleting local node_modules directory and running npm install

boston99green avatar Dec 08 '17 19:12 boston99green

I got this error when had package.json with typescript >2.5 with typescript 2.6 installed. saying =2.5.3; and doing the npm/node modules 'cleanse' (i.e. npm cache clear, rmdir node_modules and npm uninstall @angular/cli -g, npm remove @angular/cli ) finally did the trick for me with an upgraded project. hope that can help someone else.

toddwseattle avatar Dec 08 '17 22:12 toddwseattle

I solved it when I updated the typescript's version (local and global).

sergiohidalgocaceres avatar Dec 10 '17 10:12 sergiohidalgocaceres

I solved the problem be removing local version of angular CLI:

npm remove @angular/cli --save

asalhani avatar Dec 10 '17 17:12 asalhani

Had the same issue after upgrading @angular/cli to version 1.6.0 both globally and locally. I tried a proposed resolution of upgrading rxjs version to 5.5.5 but that didn't still solve the issue.

Command ran: ng g service was throwing the same error

Error: input.mergeMap is not a function TypeError: input.mergeMap is not a function at Object.callRule (.../@angular-devkit/schematics/src/rules/call.js:70:18)

Temporary Resolution: Reverted to v1.5.0 of @angular/cli, deleted node_modules and ran yarn install again

Further Information OS: Ubuntu 16.04 Seems the dependencies for @angular/cli and @angular-devkit/schematics are not upgraded ├─ @angular-devkit/[email protected] │ ├─ @angular-devkit/[email protected] │ ├─ @ngtools/json-schema@^1.1.0 │ ├─ @schematics/[email protected] │ ├─ minimist@^1.2.0 │ ├─ rxjs@^5.5.2 │ ├─ [email protected] │ │ └─ symbol-observable@^1.0.1 │ └─ [email protected] ├─ @angular/[email protected] │ └─ tslib@^1.7.1 ├─ @angular/[email protected] │ ├─ @angular-devkit/build-optimizer@~0.0.35 │ ├─ @angular-devkit/schematics@~0.0.40 │ ├─ @ngtools/[email protected] │ ├─ @ngtools/[email protected] │ ├─ @schematics/angular@~0.1.10 │ ├─ autoprefixer@^6.5.3 │ ├─ chalk@~2.2.0 │ ├─ [email protected] │ │ ├─ ansi-styles@^3.1.0 │ │ ├─ escape-string-regexp@^1.0.5 │ │ └─ supports-color@^4.0.0 │ ├─ circular-dependency-plugin@^4.2.1 │ ├─ common-tags@^1.3.1 │ ├─ copy-webpack-plugin@^4.1.1 │ ├─ core-object@^3.1.0 │ ├─ css-loader@^0.28.1 │ ├─ cssnano@^3.10.0 │ ├─ denodeify@^1.2.1 │ ├─ ember-cli-string-utils@^1.0.0 │ ├─ exports-loader@^0.6.3 │ ├─ extract-text-webpack-plugin@^3.0.2 │ ├─ file-loader@^1.1.5 │ ├─ fs-extra@^4.0.0 │ ├─ glob@^7.0.3 │ ├─ html-webpack-plugin@^2.29.0 │ ├─ istanbul-instrumenter-loader@^2.0.0 │ ├─ karma-source-map-support@^1.2.0 │ ├─ less-loader@^4.0.5 │ ├─ less@^2.7.2 │ ├─ license-webpack-plugin@^1.0.0 │ ├─ lodash@^4.11.1 │ ├─ memory-fs@^0.4.1 │ ├─ minimatch@^3.0.4 │ ├─ node-modules-path@^1.0.0 │ ├─ node-sass@^4.3.0 │ ├─ nopt@^4.0.1 │ ├─ opn@~5.1.0 │ ├─ portfinder@~1.0.12 │ ├─ postcss-custom-properties@^6.1.0 │ ├─ postcss-loader@^2.0.8 │ ├─ postcss-url@^7.1.2 │ ├─ raw-loader@^0.5.1 │ ├─ resolve@^1.1.7 │ ├─ rxjs@^5.5.2 │ ├─ [email protected] │ │ └─ symbol-observable@^1.0.1

amoswachanga avatar Dec 11 '17 19:12 amoswachanga