Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angular/30.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用Angular 9 CLI创建新项目时,如何解决纱线问题?_Angular - Fatal编程技术网

使用Angular 9 CLI创建新项目时,如何解决纱线问题?

使用Angular 9 CLI创建新项目时,如何解决纱线问题?,angular,Angular,我尝试使用Angular CLI创建新项目,但出现以下错误: yarn is not recognized as internal or external command 以下是控制台日志: C:\Users\sabir>ng new hello-world ? Would you like to add Angular routing? No ? Which stylesheet format would you like to use? CSS CREATE hello-world/

我尝试使用Angular CLI创建新项目,但出现以下错误:

yarn is not recognized as internal or external command
以下是控制台日志:

C:\Users\sabir>ng new hello-world
? Would you like to add Angular routing? No
? Which stylesheet format would you like to use? CSS
CREATE hello-world/angular.json (3606 bytes)
CREATE hello-world/package.json (1287 bytes)
CREATE hello-world/README.md (1027 bytes)
CREATE hello-world/tsconfig.json (489 bytes)
CREATE hello-world/tslint.json (3125 bytes)
CREATE hello-world/.editorconfig (274 bytes)
CREATE hello-world/.gitignore (631 bytes)
CREATE hello-world/browserslist (429 bytes)
CREATE hello-world/karma.conf.js (1023 bytes)
CREATE hello-world/tsconfig.app.json (210 bytes)
CREATE hello-world/tsconfig.spec.json (270 bytes)
CREATE hello-world/src/favicon.ico (948 bytes)
CREATE hello-world/src/index.html (296 bytes)
CREATE hello-world/src/main.ts (372 bytes)
CREATE hello-world/src/polyfills.ts (2835 bytes)
CREATE hello-world/src/styles.css (80 bytes)
CREATE hello-world/src/test.ts (753 bytes)
CREATE hello-world/src/assets/.gitkeep (0 bytes)
CREATE hello-world/src/environments/environment.prod.ts (51 bytes)
CREATE hello-world/src/environments/environment.ts (662 bytes)
CREATE hello-world/src/app/app.module.ts (314 bytes)
CREATE hello-world/src/app/app.component.html (25725 bytes)
CREATE hello-world/src/app/app.component.spec.ts (957 bytes)
CREATE hello-world/src/app/app.component.ts (215 bytes)
CREATE hello-world/src/app/app.component.css (0 bytes)
CREATE hello-world/e2e/protractor.conf.js (808 bytes)
CREATE hello-world/e2e/tsconfig.json (214 bytes)
CREATE hello-world/e2e/src/app.e2e-spec.ts (644 bytes)`enter code here`
CREATE hello-world/e2e/src/app.po.ts (301 bytes)`enter code here`

Installing packages...'yarn' is not recognized as an internal or external command,
operable program or batch file.
× Package install failed, see above.
The Schematic workflow failed. See above.

可能是您在angular/cli中使用纱线激活的。尝试此操作并创建一个新项目:

ng config -g cli.packageManager npm

那么这个问题就不存在了。

。您可以安装它来解决问题
npm install warn-g
,但我不确定为什么需要它