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

The Angular CLI is no longer working after update

Open JoshuaAdamYoung opened this issue 8 years ago • 19 comments

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

JoshuaAdamYoung avatar Jan 11 '18 23:01 JoshuaAdamYoung

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

Node 8.5.0 NPM 5.6.0

DavidRollinsSlalom avatar Jan 11 '18 23:01 DavidRollinsSlalom

@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.

Marabyte avatar Jan 11 '18 23:01 Marabyte

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.

nsjames avatar Jan 11 '18 23:01 nsjames

@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$

DavidRollinsSlalom avatar Jan 11 '18 23:01 DavidRollinsSlalom

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

T0T4R4 avatar Jan 11 '18 23:01 T0T4R4

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

DiegoRodriguezTandil avatar Jan 11 '18 23:01 DiegoRodriguezTandil

Worked by reinstalling 1.5

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

T0T4R4 avatar Jan 11 '18 23:01 T0T4R4

Same issue here as well

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

aarndt avatar Jan 11 '18 23:01 aarndt

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.

wdsims63 avatar Jan 11 '18 23:01 wdsims63

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

T0T4R4 avatar Jan 11 '18 23:01 T0T4R4

I fixed it running:

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

viniciuspsw avatar Jan 12 '18 00:01 viniciuspsw

Update: fixed by upgrading to node v9.4.0

JoshuaAdamYoung avatar Jan 12 '18 00:01 JoshuaAdamYoung

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.

aarndt avatar Jan 12 '18 00:01 aarndt

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

T0T4R4 avatar Jan 12 '18 00:01 T0T4R4

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

DiegoRodriguezTandil avatar Jan 12 '18 00:01 DiegoRodriguezTandil

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

pacalabre avatar Jan 12 '18 00:01 pacalabre

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 avatar Jan 12 '18 15:01 mboughaba

@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.

pacalabre avatar Jan 12 '18 17:01 pacalabre

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.