简体   繁体   中英

@angular/cli: ng new angular, error angular cli unknown option --silent

I am trying to create a new angular cli project but it shows me error when I am creating one with ng new project

  $ng new project
  create project/README.md (1023 bytes)
  create project/.angular-cli.json (1242 bytes)
  create project/.editorconfig (245 bytes)
  create project/.gitignore (544 bytes)
  create project/src/assets/.gitkeep (0 bytes)
  create project/src/environments/environment.prod.ts (51 bytes)
  create project/src/environments/environment.ts (387 bytes)
  create project/src/favicon.ico (5430 bytes)
  create project/src/index.html (294 bytes)
  create project/src/main.ts (370 bytes)
  create project/src/polyfills.ts (3114 bytes)
  create project/src/styles.css (80 bytes)
  create project/src/test.ts (642 bytes)
  create project/src/tsconfig.app.json (211 bytes)
  create project/src/tsconfig.spec.json (283 bytes)
  create project/src/typings.d.ts (104 bytes)
  create project/e2e/app.e2e-spec.ts (289 bytes)
  create project/e2e/app.po.ts (208 bytes)
  create project/e2e/tsconfig.e2e.json (235 bytes)
  create project/karma.conf.js (923 bytes)
  create project/package.json (1292 bytes)
  create project/protractor.conf.js (722 bytes)
  create project/tsconfig.json (363 bytes)
  create project/tslint.json (3012 bytes)
  create project/src/app/app.module.ts (316 bytes)
  create project/src/app/app.component.css (0 bytes)
  create project/src/app/app.component.html (1141 bytes)
  create project/src/app/app.component.spec.ts (986 bytes)
  create project/src/app/app.component.ts (207 bytes)

  error: unknown option `--silent'

Error: Package install failed, see above.
Package install failed, see above.

On Google there is no information about it and I tried to reinstall @angular/cli and clear cache for npm but it didn't help. Any suggestions?

npm version: 5.6.0

angular cli: 1.7.4

node: 7.2.0 (updated to 9.11.1 but it didn't help(

Try using

--skipTests=true

Hope this help !

尝试通过运行npm i -g npm (到 5.8.0)来更新 npm。

Please try

ng config -g cli.packageManager npm

may be packagemanager is set to yarn

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM