angular / angular-cli

CLI tool for Angular
https://cli.angular.io
MIT License
26.68k stars 11.98k forks source link

Error: dryRunSink.commit(...).ignoreElements(...).concat is not a function #9194

Closed rilwans closed 6 years ago

rilwans commented 6 years ago

Just Upgraded to Angular CLI: 1.6.4

each time I run ng new I get this error

Error: dryRunSink.commit(...).ignoreElements(...).concat is not a function dryRunSink.commit(...).ignoreElements(...).concat is not a function

alexsapran commented 6 years ago

same, just installed the cli and getting the same error. [Update] Tried a couple of versions

Angular CLI: 1.7.0-beta.0
Node: 9.4.0
OS: darwin x64
Angular:
----
Angular CLI: 1.6.0
Node: 9.4.0
OS: darwin x64
Angular:
----
Angular CLI: 1.6.3
Node: 9.4.0
OS: darwin x64
Angular:

With the same result

ghost commented 6 years ago

I am getting this error, too.

Angular CLI: 1.6.4 Node: 7.10.0 OS: linux x64 Angular: ...

j-c-levin commented 6 years ago

Me too Angular cli: 1.6.4 Node: 8.8.1 OS: Windows 10

fhnaseer commented 6 years ago

Same error, Angular CLI: 1.6.4 Node: 8.9.4 OS: win32 x64

nilsfriess commented 6 years ago

Same Error: Angular CLI: 1.6.4 Node: 9.4.0 OS: linux x64 npm --version: 5.6.0

anankassis commented 6 years ago

oh my god ! i am having the same problem ! in addition now ! i re down graded to my working version 1.5.3 , that was working all the time perfectly, and still ! i receive the same error ! nothing is fixing my problem !!! HELP NEEDED

derobiom commented 6 years ago

I can offer no help. But I have deep sympathy as I see the same problem.

mendhak commented 6 years ago

Following this worked -

npm install @angular-devkit/schematics@0.0.45 @angular/cli --no-save
$(npm bin)/ng new my-new-app
nilsfriess commented 6 years ago

https://github.com/angular/devkit/commit/e1f435606ffcf29b3311ab7204ef3eb84d661be2#diff-0dfbc02885bfb31a1e86e72520aad335

This is the commit in the schematics.ts file in the package @angular-devkit/schematics which is causing the problem

As this is just some refactoring, maybe it would be best to just go back. See this issue on the devkit github: https://github.com/angular/devkit/issues/380

nilsfriess commented 6 years ago

See @maymarx answer in https://github.com/angular/devkit/issues/380:

adding "@angular-devkit/schematics":"0.0.42", "@angular-devkit/core": "0.0.23", to the package.json fixes the problems if you need a quick fix before the weekend

slick-k commented 6 years ago

Same issue here too guys and gals!

derobiom commented 6 years ago

Adding "@angular-devkit/schematics":"0.0.42", "@angular-devkit/core": "0.0.23", to the package.json (dev dependencies) worked for me also.

anankassis commented 6 years ago

how you add those things you talked about ?! exactly ??? like what to add ?? just "":"0.0.42", "": "0.0.23" ???

iamviswajith commented 6 years ago

i have the same issue, after adding "@angular-devkit/schematics":"0.0.42", "@angular-devkit/core": "0.0.23", to the package.json, i uninstalled angular cli and re installed it, but the same issue pops up

gurgelv commented 6 years ago

they are dependencies which can be added to the package.json of your project, and no "":"0.0.42", "": "0.0.23" is not enough. you need the full dependency names: "@angular-devkit/schematics":"0.0.42", "@angular-devkit/core": "0.0.23"

In my case, I had no project to add these dependencies to (creating a new one now), so I had to follow @eclanrs's solution at https://github.com/angular/devkit/issues/380:

npm i @angular-devkit/schematics@0.0.45 @angular/cli --no-save
iamviswajith commented 6 years ago

thanks @gurgelv that worked 👍

ricartoons commented 6 years ago

Thanks @gurgelv, works!

anankassis commented 6 years ago

That will make you able to create a new project correct !! but try to do ng new component name you will still get : Error: dryRunSink.commit(...).ignoreElements(...).concat is not a function dryRunSink.commit(...).ignoreElements(...).concat is not a function

IgorKharkiv commented 6 years ago

Adding

"@angular-devkit/schematics":"0.0.42", 
"@angular-devkit/core": "0.0.23" 

into devDependencies don't resolve problem in my case. The build still broken.

LeezMito commented 6 years ago

i have of same problem :C

salimperwaiz commented 6 years ago

I am also stuck with same error: Angular CLI: 1.6.4 Node: 8.9.4 OS: win32 x64 Angular:

tarah-s commented 6 years ago

Great solution @gurgelv works perfect!

casehill commented 6 years ago

thank u! @gurgelv it works fine!

derobiom commented 6 years ago

For some reason I had a earlier local version of the CLI? Make sure you don't. Mine seems to be working now (not getting this error) with the above additions to package.json BUT I think there may be other problems. But I'm able to create components and modules. Angular CLI: 1.6.4 Node: v8.9.1 OS: Win10 x64

salimperwaiz commented 6 years ago

Thank you @gurgelv it works!

anankassis commented 6 years ago

I Needed to npm install , after adding those lines to the dev dependencies , and i think now it is working

DiegoRodriguezTandil commented 6 years ago

I have the same error: "Error: dryRunSink.commit(...)"

Maybe I would to reinstall Angular CLI 1.5 The commands that I used

cdCarlos commented 6 years ago

The same problem here.

Node: 8.5 NPM: 5.3

ng-cli: 1.4.3 ng-cli: 1.5.3 ng-cli: 1.6.4

I've tried with the above cli's versions and is the same problem. For 1.4 and 1.5 cli version I can't create new components, with 1.6 version I can't create new projects.

Metrophobe commented 6 years ago

i don't get it ... was working fine just a while ago and then i got the dreaded error why is rolling back to an older version of the cli still producing the same error? tried 1.5.3

Brocco commented 6 years ago

There is a fix about to be released for this based upon PR angular/devkit#384

Cosmin-Parvulescu commented 6 years ago

@Metrophobe I think the issue is with the angular/devkit dependency, so even if you use lower releases of ng-cli you'll still get the faulty dependency.

Metrophobe commented 6 years ago

@Metrophobe I think the issue is with the angular/devkit dependency, so even if you use lower releases of ng-cli you'll still get the faulty dependency.

so can we actually install an older angular/devkit and get back up and running ? the proposed solution previously further up is not working for me ... projects/ components not generating and am in the middle of some work! :(

Metrophobe commented 6 years ago

There is a fix about to be released for this based upon PR angular/devkit#384

Many thanks for the effort! How do I apply this fix ?

Brocco commented 6 years ago

Working on getting it released to npm, so all you would need to do is reinstall.

rilwans commented 6 years ago

@Brocco Thanks

Cosmin-Parvulescu commented 6 years ago

@Brocco, does it fix the whole range of issues including the generator commands?

DiegoRodriguezTandil commented 6 years ago

@Brocco I reinstall angular-cli and the ng new is fixed but ng generate is still failing Should I have to update anything else? Node: 9.4.0 CLI: 1.6.4

Cosmin-Parvulescu commented 6 years ago

@DiegoRodriguezTandil, the fix is not on NPM yet, you can check it out on the project page...

gareththomasnz commented 6 years ago

Oh boy - I guess there will be a fix by tomorrow

Brocco commented 6 years ago

@Cosmin-Parvulescu it will fix generate commands as well.

Brocco commented 6 years ago

FYI The updated version of @angular-devkit/schematics has been published, the correct version of that package should be 0.0.48.

Closing this issue now, thank you for your patience and for following up on this issue!!! ❤️

intellix commented 6 years ago

Still getting this one myself:

$ ng g c player/inventory-form
Error: dryRunSink.commit(...).ignoreElements is not a function
dryRunSink.commit(...).ignoreElements is not a function
Angular CLI: 1.6.4
Node: 8.9.4
OS: darwin x64
Angular: 5.2.0
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router, service-worker

@angular/cli: 1.6.4
@angular-devkit/build-optimizer: 0.0.38
@angular-devkit/core: 0.0.25
@angular-devkit/schematics: 0.0.48
@ngtools/json-schema: 1.1.0
@ngtools/webpack: 1.9.4
@schematics/angular: 0.1.13
@schematics/schematics: 0.0.13
typescript: 2.5.3
webpack: 3.10.0

I'm also using NX and am not sure if that changes anything. If it does then it might be helpful to list schematic collections when running ng v

ghost commented 6 years ago

@gurgelv Well played man!

fmorriso commented 6 years ago

Here are the steps that fixed this issue for an existing project that began to fail after upgrading to Angular-CLI 1.6.4:

  1. create a new project using ng new in a different directory, such as c:\projects\aacli\
  2. change to the root directory of the newly created project (e.g., c:\projects\aacli)
  3. perform a dry run to create a service, component, or module. For example try ng generate service aatest --dry-run (NOTE: the reason I suggest using the --dry-run switch throughout this sequence of diagnostic and repair steps is that it does not create anything, but it does help understand if the issue is present in your project )
  4. If you encountered the error that is the main topic of this thread, continue with the remaining steps; otherwise, your project does not suffer from the issue and you should not continue with the remaining steps.
  5. switch to the root directory of the failing project
  6. make a copy of package.json in the failing project (e.g., package-backup.json)
  7. compare the generated package.json file in the new project to the one used in the failing project.
  8. carefully copy only the lines of "dependencies" that match by key from the new project (aacli\package.json) to the failing project.
  9. copy all of the "devDependencies" portion of package.json from the new project to the failing project's equivalent "devDependencies".
  10. rename package-lock.json in the failing project to something else, such as package-lock.backup.
  11. delete the node_modules directory in the failing project.
  12. run npm install in the failing project.'s root directory.
  13. perform a dry run to create a service, component, or module, such as ng generate service aatest --dry-run

The above sequence of steps worked for me on January 14, 2018 at approximately 8:15 AM EST.

After performing the above steps, when I ran ng --version in the (previously failing) project's top-level directory, it produced the following output:

Angular CLI: 1.6.4
Node: 8.9.4
OS: win32 x64
Angular: 5.2.0
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router

@angular/cdk: 5.0.4
@angular/cli: 1.6.4
@angular/flex-layout: 2.0.0-beta.12
@angular/material: 5.0.4
@angular-devkit/build-optimizer: 0.0.38
@angular-devkit/core: 0.0.25
@angular-devkit/schematics: 0.0.48
@ngtools/json-schema: 1.1.0
@ngtools/webpack: 1.9.4
@schematics/angular: 0.1.13
@schematics/schematics: 0.0.13
typescript: 2.5.3
webpack: 3.10.0
byrondover commented 6 years ago

I was getting the same issue as @intellix with an existing project. Purging lock files and node_modules worked for me.

rm -rf node_modules package-lock.json yarn.lock
yarn || npm install

Just a quick note for Hans and Mike: we know Schematics are work-in-progress (and super exciting!), but this isn't the first time they've affected the stability of Angular CLI core. Perhaps it's worth considering confining Schematics improvements to a non-critical path branch (e.g. 1.7.0) until they too are 1.0 ready. :bowtie:

goldy-suryan commented 6 years ago

"npm i @angular-devkit/schematics":"0.0.42", "@angular-devkit/core": "0.0.23" worked for me. thanks @gurgelv

gehreleth commented 6 years ago

Installing @angular-devkit/schematics@0.0.48 solved this problem, I can generate new services and components now. But another annoying unresolved dependency popped up instead:

@schematics/angular@0.1.13 requires a peer of @angular-devkit/schematics@0.0.46 but none was installed

ltejoles commented 6 years ago

I have the same issue as @gehreleth. Not sure what to do here ...

gehreleth commented 6 years ago

Wait until @schematics/angular's dependency got updated to match @angular-devkit/schematics@0.0.48, I guess. It's not blocking, just outputs annoying warnings during build process.

ltejoles commented 6 years ago

I was able to make it work by downgrading the angular-cli to 1.32 "@angular/cli": "1.3.2",