问题描述
我已删除npm和node.此外,我已经删除并恢复了自制软件.我从在线下载站点下载了npm和node来还原它们.我还通过npm下载了角度cli.我通过终端找到了桌面,然后输入
I have deleted npm and node. In addition, I have deleted and restored homebrew. I downloaded npm and node from the online download site to restore them. I also downloaded the angular cli through npm. I located my desktop through the terminal and typed
ng new mag-board
开始我的角度项目.系统提示我出现以下错误:
to begin my angular project. I was prompted with the following error:
Schematic "ng-new" not found in collection "@schematics/angular".
Error: Schematic "ng-new" not found in collection "@schematics/angular".
at SchematicEngine.createSchematic (/usr/local/lib/node_modules/@angular/cli/node_modules/@angular-devkit/schematics/src/engine/engine.js:232:23)
at CollectionImpl.createSchematic (/usr/local/lib/node_modules/@angular/cli/node_modules/@angular-devkit/schematics/src/engine/engine.js:69:29)
at NewCommand.getSchematic (/usr/local/lib/node_modules/@angular/cli/models/schematic-command.js:130:27)
at NewCommand.initialize (/usr/local/lib/node_modules/@angular/cli/models/schematic-command.js:43:36)
at process._tickCallback (internal/process/next_tick.js:68:7)
at Function.Module.runMain (internal/modules/cjs/loader.js:757:11)
at startup (internal/bootstrap/node.js:283:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)
我删除了npm,删除节点,我删除了Angular CLI
I Deleted npm,Deleted node, and IDeleted Angular CLI
我重新安装了npm,node和Angular CLI
I reinstalled npm, node, and Angular CLI
我应该能够通过输入ng new mag-board来生成Angular项目
I should be able to generate an Angular project from typing ng new mag-board
推荐答案
您可以在 https://github.com/angular/angular-cli/issues/10862
我将为您做空:
第一个选项:
sudo npm uninstall @schematics/angular
和
sudo npm i @schematics/angular
如果没有出现问题,则:
删除主目录中的node_modules文件夹.
Remove the node_modules folder in your home directory.
这篇关于"ng-new"在集合"@ schematics/angular"中未找到的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!