Angular-cli: The Angular CLI is no longer working after update

Created on 12 Jan 2018  Â·  19Comments  Â·  Source: angular/angular-cli

The Angular CLI is no longer working after update

Versions

Angular CLI: 1.6.4
Node: 8.0.0
OS: linux ia32 (Lubuntu 17.04)
Angular: 
...


Repro steps

...

  • Step 1
    ng new

...

Observed behavior

Error: You provided an invalid object where a stream was expected. You can provide an Observable, Promise, Array, or Iterable.
You provided an invalid object where a stream was expected. You can provide an Observable, Promise, Array, or Iterable.

Desired behavior

To create a new Angular project

Mention any other details that might be useful (optional)

It was working up until I updated the angular CLI with npm i -g @angular/cli

Most helpful comment

I fixed it running:

npm un -g @angular/cli
npm cache clean --force
npm i -g @angular/cli

All 19 comments

note... I also tried to install previous versions and see the same behavior.

Node 8.5.0
NPM 5.6.0

@JoshuaAdamYoung and @DavidRollinsSlalom do you guys get this warning?
npm WARN @schematics/[email protected] requires a peer of @angular-devkit/[email protected] but none is installed. You must install peer dependencies yourself.

I'm seeing the same thing.

$ ng --version
_                      _                 ____ _     ___
/ \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
/ â–³ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
/ ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
/_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
|___/

Angular CLI: 1.6.4
Node: 6.9.5
OS: win32 x64
Angular:
...

$ ng new ngtest
Error: You provided an invalid object where a stream was expected. You can provide an Observable, Promise, Array, or Iterable.
You provided an invalid object where a stream was expected. You can provide an Observable, Promise, Array, or Iterable.

@Marabyte yes that's what I'm seeing.

24612-MBPR:github david.rollins$ npm install -g @angular/cli
/Users/david.rollins/.nvm/versions/node/v8.5.0/bin/ng -> /Users/david.rollins/.nvm/versions/node/v8.5.0/lib/node_modules/@angular/cli/bin/ng
npm WARN @schematics/[email protected] requires a peer of @angular-devkit/[email protected] but none is installed. You must install peer dependencies yourself.

+ @angular/[email protected]
added 169 packages, removed 49 packages, updated 13 packages and moved 4 packages in 27.899s
24612-MBPR:github david.rollins$ ng new my-app
Error: You provided an invalid object where a stream was expected. You can provide an Observable, Promise, Array, or Iterable.
You provided an invalid object where a stream was expected. You can provide an Observable, Promise, Array, or Iterable.
24612-MBPR:github david.rollins$

Same here on fedora 27

$ ng version
Angular CLI: 1.6.4
Node: 8.9.3
OS: linux x64
Angular: 
...

then

$ ng new ang5
Error: You provided an invalid object where a stream was expected. You can provide an Observable, Promise, Array, or Iterable.
You provided an invalid object where a stream was expected. You can provide an Observable, Promise, Array, or Iterable.

with :

$ node -v
v8.9.3
$ npm -v
5.5.1

I'm having the same error in MacOS.

npm -v
5.6.0

and

Angular CLI: 1.6.4
Node: 8.9.1
OS: darwin x64

Worked by reinstalling 1.5

sudo npm uninstall -g @angular/cli
sudo npm install -g @angular/[email protected]

Same issue here as well

Angular CLI: 1.6.4
Node: 8.5.0
OS: win32 x64
NPM: 5.2.0

Same for me on macOS as well. However, I got it working by:
sudo npm uninstall -g angular/cli @angular/cli
then
sudo nom install -g @angular/[email protected]

It was quite annoying since I even dropped down from node 8.x back node 6.x thinking there was come problem there since I just updated node/npm today.

Tried to uninstall 1.5 to test 1.6.2 but when installing 1.6.2

sudo npm install -g @angular/[email protected]

and it came with the infernal issue already raised with the following looping forever :

gyp verb command install [ '8.9.3' ]
gyp verb install input version string "8.9.3"
gyp verb install installing version: 8.9.3
gyp verb install --ensure was passed, so won't reinstall if already installed
gyp verb install version not already installed, continuing with install 8.9.3
gyp verb ensuring nodedir is created /usr/lib/node_modules/@angular/cli/node_modules/node-sass/.node-gyp/8.9.3
gyp WARN EACCES user "root" does not have permission to access the dev dir "/usr/lib/node_modules/@angular/cli/node_modules/node-sass/.node-gyp/8.9.3"
gyp WARN EACCES attempting to reinstall using temporary dev dir "/usr/lib/node_modules/@angular/cli/node_modules/node-sass/.node-gyp"
gyp verb tmpdir == cwd automatically will remove dev files after to save disk space

I suspect the installation script to mess up permissions, as I already did earlier

sudo chown -R root:root /usr/lib/node_modules

I fixed it running:

npm un -g @angular/cli
npm cache clean --force
npm i -g @angular/cli

Update: fixed by upgrading to node v9.4.0

Update: fixed by upgrading to node v9.4.0

Should this be considered a solution? According to the CLI docs:

Both the CLI and generated project have dependencies that require Node 6.9.0 or higher, together with NPM 3 or higher.

Really, we shoulnd't have to do a cache clean....
and still anything I do now throws me this infernal loop

I follow the steps

  • Update Node, npm latest version
  • Remove angular-cli 1.6.3
  • Install angular-cli 1.5

but the infernal loop is still there

But I could not create application, component and others

I'm also having this issue on my work computer:
@angular/cli: 1.6.4
node: 9.4.0
os: win32x64

But it works fine on my personal computer:
@angular/cli: 1.4.9
node: 6.10.2
os: darwin x64

Same issue on LTS node and angular cli 1.6.3.
Using 1.6.4 I get:

λ ng generate service core/configuration --module=app
Error: Path "/__path__/__name@dasherize@if-flat__/__name@dasherize__.service.spec.ts" does not exist.
Path "/__path__/__name@dasherize@if-flat__/__name@dasherize__.service.spec.ts" does not exist.

Removing cli and installing it doesn't help at all
Also upgrading to node v9.4.0 is not helping

@mboughaba seemed to have figured out the issue in the link below:
https://github.com/angular/angular-cli/issues/9187

His fix regarding the dependency worked for me.

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

_This action has been performed automatically by a bot._

Was this page helpful?
0 / 5 - 0 ratings