在运行角4项目时,我得到了以下错误。
you seem to not be depending on "@angular/core". This is an error.如需详细解释,请参阅以下图片:
当前版本:角Cli : 1.7.3节点: 8.10.0

我尝试过这样的选择:
rm -rf node_modules
rm package-lock.json
npm install在运行上面的命令时,我得到了以下错误:
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN @angular/material@5.2.4 requires a peer of @angular/core@^5.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN @angular/material@5.2.4 requires a peer of @angular/common@^5.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN @angular/cdk@5.2.4 requires a peer of @angular/core@^5.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN @angular/cdk@5.2.4 requires a peer of @angular/common@^5.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN @ng-bootstrap/ng-bootstrap@1.0.2 requires a peer of @angular/core@^5.0.2 but none is installed. You must install peer dependencies yourself.
npm WARN @ng-bootstrap/ng-bootstrap@1.0.2 requires a peer of @angular/common@^5.0.2 but none is installed. You must install peer dependencies yourself.
npm WARN @ng-bootstrap/ng-bootstrap@1.0.2 requires a peer of @angular/forms@^5.0.2 but none is installed. You must install peer dependencies yourself.
npm WARN @angular-devkit/schematics@0.0.52 requires a peer of @angular-devkit/core@0.0.29 but none is installed. You must install peer dependencies yourself.
npm WARN @schematics/angular@0.0.49 requires a peer of @angular-devkit/schematics@0.0.34 but none is installed. You must install peer dependencies yourself.
npm WARN ajv-keywords@3.1.0 requires a peer of ajv@^6.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.1.3 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})发布于 2018-03-22 12:37:59
我通过运行以下命令获得了解决方案:
删除您的节点模块,检查您的package.json文件应该有@ar角/core,然后用npm i重新安装它。
https://askubuntu.com/questions/1018143
复制相似问题