gpt4 book ai didi

javascript - 错误 : Could not resolve module @angular/core

转载 作者:数据小太阳 更新时间:2023-10-29 04:52:01 25 4
gpt4 key购买 nike

我正在尝试运行 angular 4 应用程序,但我一直收到此错误

ERROR in Could not resolve module @angular/core

没有其他错误。没有任何依赖错误。 @angular/core 存在于 node_modules 文件夹中。我已经尝试安装 @angular/cli 并且没有但对此错误没有影响。我不确定如何解决这个问题。它出现在我的 amazon ec2 机器上,但不出现在我的本地 Mac 机器上。库的版本都是一样的。

任何帮助将不胜感激。谢谢。

最佳答案

如果有人仍然面临这样的问题-

您的 package.json 可能已损坏。请按照以下步骤操作:

  1. 删除 node_module 文件夹。
  2. 清理/清除缓存。要清除缓存,请运行以下命令。

    npm 缓存清理 --force

  3. 再次安装 angular/core 库(您的应用程序的特定版本)。

    npm i @angular/core

  4. 再次运行 npm install

关于javascript - 错误 : Could not resolve module @angular/core,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47221726/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com