Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
465 views
in Technique[技术] by (71.8m points)

node.js - Angular CLI ng new error

I've installed node from https://nodejs.org/en/download and then I installed angular CLI via NPM using

npm install -g @angular/cli

After it's done, I then try to create a new angular project

ng new new-project

And I get the following error

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.

I've tried installing the cli using sudo (and without) and I've reinstalled node: I always get the same error.

I can't find anything about anyone having this issue.

I'm using MacOS.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Try to use an older version of Angular CLI until this problem get solved.

You can follow this issue in https://github.com/angular/angular-cli/issues/9172.

EDIT: I found a solution, run these commands:

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

It worked for me.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...