ng g input.mergeMap is not a function
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 ]
I had the same issue after upgrading to the @angular/cli 1.6.0 and was able to resolve it using:
npm i --save-dev @angular/cli@latest
and
npm i typescript@latest -g
as some others mentioned above.
The versions of Angular Cli and TypeScript (local and global) must be the same. Execute: ng -v tsc -v
Then see the versions in package.json. If they are different, then update them.
Globally
npm remove -g @angular/cli npm remove -g typescript
npm i -g @angular/cli@latest npm i -g typescript@latest
Locally
Delete the directories node_modules and dist of your project.
npm i @angular/cli@latest --save-dev npm i typescript@latest --save-dev npm install
That was working for me.
After upgrading from 4 to 5, I had to delete package-lock.json and run npm install - that fixed the problem.
tried all mentioned solutions but doesn't work for me.
I have the latest versions of CLI and TS both locally and globally. Removing node_modules and installing it doesn't help. Removing package-lock.json doesn't help either.
Any other variants?
@matiishyn Did you make sure to clear out your global cached files before installing the global CLI and TS? Also, is your rxjs@^5.5.5?
Just did, same error. And yes, rxjs@^5.5.5. What else can I do?
@matiishyn - I can't find the reference now, but a similar issue was fixed for me by npm install @angular-devkit/[email protected]
Installing @angular-devkit/[email protected] seems to have solved the problem for me. Worked like magic
Had same problem. Tried all recommendations above. Only deleting node_modules and package-lock.json worked out.
Installing rxjs@^5.5.5 on angular/cli worked for me.
npm i @angular-devkit/[email protected]
npm install --save-dev @angular/cli@latest
running these two worked for me..
把项目的angular版本更新到5.0.0可以彻底解决这个问题。
Can someone explain WHY npm install @angular-devkit/[email protected] --save-dev fixes it?
And also why schematics isn't in my package.json file after running this - yes it does work?
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
@joseques Thanks. uninstalling the local angular CLI worked.
installed latest one and working fine
npm install @angular-devkit/schematics --save-dev
@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
I too had the same problem, it worked after I removed cli from the local project.
npm remove @angular/cli --save
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.