Angular CLI ng new error

假装没事ソ 提交于 2020-01-09 11:48:50

问题


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.


回答1:


I follow the steps

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

I could create application, component and others

updated 12-JAN

I update angular-cli up 1.6.4, Node up 9.4.0 and worked fine for me to create new project




回答2:


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.




回答3:


Issue has been fixed.

Remove node_modules and run npm install to get the latest dependencies.




回答4:


Confirmed issue on:

Angular CLI: 1.6.3 Node: 6.10.3 OS: win32 x64

Angular CLI: 1.6.3 Node: 6.10.3 OS: linux x64

Angular CLI: 1.6.4 Node: 8.0.0 OS: win32 x64

In each cases i'm using nvm.

Works after uninstalling and specifically installing angular cli version 1.5.5




回答5:


Follow this issues in https://github.com/angular/angular-cli/issues/9187

Install in your project

npm install @angular-devkit/schematics

ng -v

Angular CLI: 1.6.3
Node: 9.2.0
OS: linux x64
Angular: 5.2.0


来源:https://stackoverflow.com/questions/48217313/angular-cli-ng-new-error

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!