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

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 <projectname>

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

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 13
  • Comments: 19

Most upvoted comments

I fixed it running:

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

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/cli@1.6.2

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.

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.

Tried to uninstall 1.5 to test 1.6.2 but when installing 1.6.2

sudo npm install -g @angular/cli@1.6.2

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

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

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