ng new hello-world 不工作,npm 缓存清理也不工作

ng new hello-world not working and npm cache clean not working too

我在尝试生成新应用时遇到此错误并尝试了 ng cache clean --force 但它不起作用 尝试重新安装 node.js 和 npm 以及 angular cli,但其中 none 对我有用 我知道这可能看起来像是重复的,但即使我写 npm cache clean --force

我也没有这个
C:\Users\ahmed\Desktop>npm cache clean --force
npm WARN using --force I sure hope you know what you are doing.

C:\Users\ahmed\Desktop>ng new hello-world
CREATE hello-world/angular.json (3593 bytes)
CREATE hello-world/package.json (1315 bytes)
CREATE hello-world/README.md (1027 bytes)
CREATE hello-world/tsconfig.json (384 bytes)
CREATE hello-world/tslint.json (2805 bytes)
CREATE hello-world/.editorconfig (245 bytes)
CREATE hello-world/.gitignore (503 bytes)
CREATE hello-world/src/environments/environment.prod.ts (51 bytes)
CREATE hello-world/src/environments/environment.ts (631 bytes)
CREATE hello-world/src/favicon.ico (5430 bytes)
CREATE hello-world/src/index.html (297 bytes)
CREATE hello-world/src/main.ts (370 bytes)
CREATE hello-world/src/polyfills.ts (3194 bytes)
CREATE hello-world/src/test.ts (642 bytes)
CREATE hello-world/src/assets/.gitkeep (0 bytes)
CREATE hello-world/src/styles.css (80 bytes)
CREATE hello-world/src/browserslist (375 bytes)
CREATE hello-world/src/karma.conf.js (964 bytes)
CREATE hello-world/src/tsconfig.app.json (194 bytes)
CREATE hello-world/src/tsconfig.spec.json (282 bytes)
CREATE hello-world/src/tslint.json (314 bytes)
CREATE hello-world/src/app/app.module.ts (314 bytes)
CREATE hello-world/src/app/app.component.html (1141 bytes)
CREATE hello-world/src/app/app.component.spec.ts (994 bytes)
CREATE hello-world/src/app/app.component.ts (207 bytes)
CREATE hello-world/src/app/app.component.css (0 bytes)
CREATE hello-world/e2e/protractor.conf.js (752 bytes)
CREATE hello-world/e2e/src/app.e2e-spec.ts (307 bytes)
CREATE hello-world/e2e/src/app.po.ts (208 bytes)
CREATE hello-world/e2e/tsconfig.e2e.json (213 bytes)
npm WARN deprecated istanbul-lib-hook@1.2.1: 1.2.0 should have been a major 
version bump
[ .................] - fetchMetadata: sill pacote version manifest for 
parseuri@0.0.5 fetched in 404ms

你试过吗

npm uninstall -g angular-cli
npm cache clean
npm install -g angular-cli@latest

试试这个(根据 https://docs.npmjs.com/cli/audit

npm audit fix

它将扫描您的项目中的漏洞并自动安装任何兼容的更新到易受攻击的依赖项