首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >你似乎不依赖于“@角形/核心”。这是个错误

你似乎不依赖于“@角形/核心”。这是个错误
EN

Ask Ubuntu用户
提问于 2018-03-22 05:30:37
回答 1查看 7.9K关注 0票数 0

在运行角4项目时,我得到了以下错误。

代码语言:javascript
复制
you seem to not be depending on "@angular/core". This is an error.

如需详细解释,请参阅以下图片:

当前版本:角Cli : 1.7.3节点: 8.10.0

我尝试过这样的选择:

代码语言:javascript
复制
rm -rf node_modules
rm package-lock.json
npm install

在运行上面的命令时,我得到了以下错误:

代码语言:javascript
复制
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"})
EN

回答 1

Ask Ubuntu用户

回答已采纳

发布于 2018-03-22 12:37:59

我通过运行以下命令获得了解决方案:

删除您的节点模块,检查您的package.json文件应该有@ar角/core,然后用npm i重新安装它。

票数 0
EN
页面原文内容由Ask Ubuntu提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://askubuntu.com/questions/1018143

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档