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

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

Open rilwans opened this issue 8 years ago • 108 comments

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

rilwans avatar Jan 12 '18 22:01 rilwans

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!!! ❤️

Brocco avatar Jan 13 '18 00:01 Brocco

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

intellix avatar Jan 13 '18 20:01 intellix

@gurgelv Well played man!

ghost avatar Jan 14 '18 10:01 ghost

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

fmorriso avatar Jan 14 '18 13:01 fmorriso

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:

byrondover avatar Jan 15 '18 03:01 byrondover

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

goldy-suryan avatar Jan 15 '18 16:01 goldy-suryan

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

@schematics/[email protected] requires a peer of @angular-devkit/[email protected] but none was installed

gehreleth avatar Jan 16 '18 00:01 gehreleth

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

ltejoles avatar Jan 16 '18 04:01 ltejoles

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

gehreleth avatar Jan 16 '18 04:01 gehreleth

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

ltejoles avatar Jan 16 '18 04:01 ltejoles

by adding "@angular-devkit/schematics":"0.0.42", "@angular-devkit/core": "0.0.23" , then run "npm install" work for me

csmrkid avatar Jan 16 '18 09:01 csmrkid

@fmorriso steps worked for me (without dry run), thanks.

Angular CLI: 1.6.4 (e)
Node: 9.4.0
OS: linux x64
Angular: 5.2.0
... common, compiler, compiler-cli, core, forms, http
... language-service, platform-browser, platform-browser-dynamic
... router

@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-concat-plugin: 1.4.0
webpack-dev-server: 2.9.3
webpack: 3.8.1

nuriu avatar Jan 16 '18 12:01 nuriu

I'm currently working on a project that has existed for 6+ months. We encountered this issue with Angular CLI when our new developers attempted to set up their dev environments and run basic Angular CLI commands. I get the following error when we attempt to generate a component:

$ ng g c some-component
Error: dryRunSink.commit(...).ignoreElements is not a function
dryRunSink.commit(...).ignoreElements is not a function

So far the only thing that has worked was downgrading to @angluar/cli to v 1.3.2. I also encountered an error regarding rxjs but that is resolved by upgrading rxjs to version 5.5.2. Here is our package.json

"dependencies": {
    "@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/platform-server": "4.4.3",
    "@angular/router": "4.4.3",
    "@types/lodash": "4.14.74",
    "angular2-csv": "0.2.5",
    "angular2-highcharts": "0.5.5",
    "core-js": "2.4.1",
    "lodash": "4.17.4",
    "ngx-bootstrap": "1.9.3",
    "rxjs": "5.1.0",
    "zone.js": "0.8.4"
  },
  "devDependencies": {
    "@angular/cli": "1.4.4",
    "@angular/compiler-cli": "4.4.3",
    "@types/jasmine": "2.5.38",
    "@types/node": "6.0.60",
    "codelyzer": "2.0.0",
    "jasmine-core": "2.5.2",
    "jasmine-spec-reporter": "3.2.0",
    "karma": "1.4.1",
    "karma-chrome-launcher": "2.1.1",
    "karma-cli": "1.0.1",
    "karma-coverage-istanbul-reporter": "0.2.0",
    "karma-jasmine": "1.1.0",
    "karma-jasmine-html-reporter": "0.2.2",
    "lite-server": "2.3.0",
    "protractor": "5.1.0",
    "ts-node": "2.0.0",
    "tslint": "4.5.0",
    "typescript": "2.2.0"
  }

Any help is greatly appreciated!

scott-engemann avatar Jan 16 '18 19:01 scott-engemann

npm install @angular-devkit/[email protected] @angular/cli --no-save

This is the vodoo that worked!

ngochibamu avatar Jan 17 '18 02:01 ngochibamu

Nope, fixed not completely. Even after upgrading @angular-devkits and purging node_modules, package.lock.json and yarn.lock.

$ ng generate service qwe
Error: dryRunSink.commit(...).ignoreElements is not a function
dryRunSink.commit(...).ignoreElements is not a function

I also confirm that downgrading to @angular/cli to 1.3.2 is the only completely working solution as of now.

Reference: Node.js: 8.9.4 x64 npm: 5.6.0 package.json:

{
  "dependencies": {
    "@angular/common": "5.0.1",
    "@angular/compiler": "5.0.1",
    "@angular/core": "5.0.1",
    "@angular/forms": "5.0.1",
    "@angular/http": "5.0.1",
    "@angular/platform-browser": "5.0.1",
    "@angular/platform-browser-dynamic": "5.0.1",
    "@angular/router": "5.0.1",
    "@angular/upgrade": "5.0.1",
    "@asymmetrik/ngx-leaflet": "^3.0.1",
    "bootstrap": "4.0.0-beta.2",
    "chart.js": "2.7.1",
    "core-js": "2.5.1",
    "font-awesome": "^4.7.0",
    "leaflet": "^1.3.0",
    "moment": "2.19.1",
    "ng2-charts": "1.6.0",
    "ngx-bootstrap": "1.9.3",
    "rxjs": "5.5.2",
    "simple-line-icons": "^2.4.1",
    "ts-helpers": "1.1.2",
    "zone.js": "0.8.18"
  },
  "devDependencies": {
    "@angular-devkit/build-optimizer": "^0.0.38",
    "@angular-devkit/core": "^0.0.25",
    "@angular-devkit/schematics": "^0.0.48",
    "@angular/cli": "^1.6.4",
    "@angular/compiler-cli": "5.0.1",
    "@types/jasmine": "2.6.3",
    "@types/leaflet": "^1.2.5",
    "@types/node": "8.0.50",
    "codelyzer": "4.0.1",
    "jasmine-core": "2.8.0",
    "jasmine-spec-reporter": "4.2.1",
    "karma": "1.7.1",
    "karma-chrome-launcher": "2.2.0",
    "karma-cli": "1.0.1",
    "karma-coverage-istanbul-reporter": "1.3.0",
    "karma-jasmine": "1.1.0",
    "karma-jasmine-html-reporter": "0.2.2",
    "protractor": "5.2.0",
    "ts-node": "3.3.0",
    "tslint": "5.8.0",
    "typescript": "2.6.1"
  }
}

Deilan avatar Jan 17 '18 15:01 Deilan

working perfectly with following :

 
"dependencies": {
    "@angular/animations": "5.2.0",
    "@angular/common": "5.2.0",
    "@angular/compiler": "5.2.0",
    "@angular/core": "5.2.0",
    "@angular/forms": "5.2.0",
    "@angular/http": "5.2.0",
    "@angular/platform-browser": "5.2.0",
    "@angular/platform-browser-dynamic": "5.2.0",
    "@angular/router": "5.2.0",
    "bootstrap": "4.0.0-beta.2",
    "core-js": "2.5.3",
    "font-awesome": "4.7.0",
    "intl": "1.2.5",
    "jquery": "3.2.1",
    "ngx-perfect-scrollbar": "5.2.0",
    "popper.js": "1.12.9",
    "rxjs": "5.5.6",
    "zone.js": "0.8.20"
  },
  "devDependencies": {
    "@angular/cli": "1.6.4",
    "@angular/compiler-cli": "5.2.0",
    "@angular/language-service": "5.2.0",
    "@types/jasmine": "2.8.4",
    "@types/node": "9.3.0",
    "codelyzer": "4.0.2",
    "jasmine-core": "2.8.0",
    "jasmine-spec-reporter": "4.2.1",
    "karma": "2.0.0",
    "karma-chrome-launcher": "2.2.0",
    "karma-cli": "1.0.1",
    "karma-coverage-istanbul-reporter": "1.3.3",
    "karma-jasmine": "1.1.1",
    "karma-jasmine-html-reporter": "0.2.2",
    "protractor": "5.2.2",
    "ts-node": "3.3.0",
    "tslib": "1.8.1",
    "tslint": "5.9.1",
    "typescript": "2.4.2"
  }

yuveliremil avatar Jan 17 '18 17:01 yuveliremil

It works for me on Angular CLI: 1.6.4 Node: 6.10.3 the common thing I can see on users had this issue is node version greater than 8 or less than 6.9

Wael3bbas avatar Jan 17 '18 17:01 Wael3bbas

I have the same problem and installing these libraries

    "@angular-devkit/build-optimizer": "^0.0.38",
    "@angular-devkit/core": "^0.0.25",
    "@angular-devkit/schematics": "^0.0.48",

does not help, someone has already found a bug-fix?

j-Cis avatar Jan 18 '18 12:01 j-Cis

Solved! Add to package.json inside devDependencies

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

Save file npm install

hugocaldeira avatar Jan 18 '18 15:01 hugocaldeira

@hugocaldeira I dont think. This way did not help me.

Dok11 avatar Jan 18 '18 15:01 Dok11