4

I am trying to create a new angular project. I followed the steps mentioned in this site. https://github.com/angular/angular-cli

When I try to create a new project using ng new command, I get error.

E:\Code\> ng new some-name
Error: dryRunSink.commit(...).ignoreElements(...).concat is not a function
dryRunSink.commit(...).ignoreElements(...).concat is not a function

Here is the result of ng serve

Angular CLI: 1.6.4
Node: 6.11.4
OS: win32 x64

Edit: Looks like everyone is getting this error. https://github.com/angular/angular-cli/issues/9194

fhnaseer
  • 7,159
  • 16
  • 60
  • 112

7 Answers7

9

Here is the link to git issue: https://github.com/angular/devkit/issues/380

Solution (temporary solution until they fix the issue): Adding the following lines to the package.json fixes the problems

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

To create new project run the following command

npm i @angular-devkit/schematics@0.0.45 @angular/cli --no-save

These solutions were provided in the git issue,

fhnaseer
  • 7,159
  • 16
  • 60
  • 112
3

Try removing the Angular CLI and reinstalling it again:

$  npm uninstall @angular/cli
$  npm cache clean
$  npm install -g @angular/cli@latest

To ensure you have the latest version. IF the problem persists, try updating the Node version (6.11.4 is a bit old). You can use nvm to update your node version. Download and install the package from here, then run

$  nvm install 8.9.0 // for example, you can have another version
$  nvm use 8.9.0 // or the version you have installed

If this STILL persists, we can assume there is a problem with @angular/cli. You can try downgrading it. Remove it again and then

$  npm install -g @angular/cli@1.1.2 // for example
Armen Vardanyan
  • 3,214
  • 1
  • 13
  • 34
  • I am still getting the same error. Upgraded node as well, but still same error, – fhnaseer Jan 12 '18 at 22:22
  • Maybe there is a problem with the new version of the CLI. You may want to downgrade to an earlier version. I have updated the answer with an instruction – Armen Vardanyan Jan 12 '18 at 22:25
  • Looks like everyone is getting this error. https://github.com/angular/angular-cli/issues/9194 – fhnaseer Jan 12 '18 at 22:25
  • Yes, I see. And yes, this is the latest version you have, then downgrade maybe to v1.6.3, should be okay. Then you may upgrade to a newer version, which would contain a fix for this issue – Armen Vardanyan Jan 12 '18 at 22:26
2

I had same problem here, just fixed with @angular/cli 1.6.5

$ npm uninstall @angular/cli
$ npm cache clean
$ npm install -g @angular/cli@latest

And in my project folder:

$ rm -rf node_modules dist
$ npm install --save-dev @angular/cli@latest
$ npm install

Now I can generate projects, components, etc normally

1

Status

This issue has been resolved in version 1.6.6.

Updating

The steps to update your environment to the latest version containing the fix:

npm uninstall -g @angular/cli
npm cache clean
# if npm version is > 5 then use `npm cache verify` to avoid errors (or to avoid using --force)
npm install -g @angular/cli@latest

rm -rf node_modules dist # use rmdir /S/Q node_modules dist in Windows Command Prompt; use rm -r -fo node_modules,dist in Windows PowerShell
npm install --save-dev @angular/cli@latest
npm install    

Explanation

The issue of [rxjs operator] is not a function is a result of the migration of the devkit repo to using "pipeable" (formerly "lettable") operators instead of the prototype patching approach that the Angular CLI was using prior to release 1.6.6 (which was just released). The commit which fixed it is here.

The issue is that the CLI was using operators that were not imported and relied on them being on the Observable object. When the devkit was updated it removed this function and the bug in the CLI was exposed. The latest version of the CLI is now using pipeable operators and therefore importing all of the operators needed to work with observables, so this issue has been resolved.

Explanation by Brocco:
https://github.com/angular/angular-cli/issues/9194#issuecomment-360615868

Nadhir Falta
  • 5,047
  • 2
  • 21
  • 43
1

below command working for me.

CMD : npm install @angular-devkit/schematics@0.0.45 @angular/cli --no-save
0

I made the following changes installing this packages:

"@angular-devkit/build-optimizer": "0.0.36",
"@angular-devkit/core": "0.0.22",
"@angular-devkit/schematics": "0.0.42",
"@schematics/angular": "^0.1.11",
"@schematics/schematics": "0.0.11"

And it works now

My Configuration

0

On angular/cli 1.6.4 I was getting "Error: dryRunSink.commit(...).ignoreElements is not a function"

The newest version has it fixed on @angular/cli: 1.6.5, you can check it out by installing it by running the following:

npm uninstall @angular/cli
npm install -g @angular/cli@latest

be sure to install the dev so you can run things like npm start(ng serve) and run your proyect by installing:

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

Worked great for me.