加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

当更新到Angular 5时,我收到错误:严重依赖:依赖的请求是一个表

发布时间:2020-12-17 08:52:40 所属栏目:安全 来源:网络整理
导读:以前我的应用程序正在使用Angular 4.4.6.我跟着 guide https://angular-update-guide.firebaseapp.com/更新为Angular 5.我使用了这个: npm install @angular/animations@'^5.0.0' @angular/common@'^5.0.0' @angular/compiler@'^5.0.0' @angular/compiler-c
以前我的应用程序正在使用Angular 4.4.6.我跟着 guide
https://angular-update-guide.firebaseapp.com/更新为Angular 5.我使用了这个:
npm install @angular/animations@'^5.0.0' @angular/common@'^5.0.0' @angular/compiler@'^5.0.0' @angular/compiler-cli@'^5.0.0' @angular/core@'^5.0.0' @angular/forms@'^5.0.0' @angular/http@'^5.0.0' @angular/platform-browser@'^5.0.0' @angular/platform-browser-dynamic@'^5.0.0' @angular/platform-server@'^5.0.0' @angular/router@'^5.0.0' typescript@2.4.2 rxjs@'^5.5.2'

但它没有用.它会给我一个错误,没有找到rxjs的有效目标.所以相反,我只是更改了我的package.json中的版本并运行了npm install并且它工作正常,但是当运行npm start时,我收到了错误

WARNING in ./~/@angular/core/esm5/core.js
6456:15-102 Critical dependency: the request of a dependency is an expression

所以我删除了我的node_modules并再次进行了npm安装,运行npm start时仍然遇到同样的错误.

截图:

我设法通过改变webpack.common.js来解决它:
new webpack.ContextReplacementPlugin(
    /(.+)?angular(|/)core(.+)?/,root('./src'),{}
)

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读