NPM链接 - 应用程序无法找到链接的库依赖性[Angular]

发布于 2025-02-13 21:19:25 字数 162 浏览 2 评论 0原文

我正在开发一个应用程序和用于所述应用程序的库。但是,我需要更新库,但是,当我使用NPM链接时,应用程序说我导入的库不需要所需的依赖项。这是一个已部署的库,当不使用NPM链接并使用已部署的版本时确实有效。我是否缺少额外的步骤将依赖项包括在链接过程中,还是我需要运行额外的命令?

任何建议都将不胜感激

I am developing an application and a library used in said application. I need to update the library, however, when I use NPM link the application says that the library I have imported does not have the dependencies required. This is a deployed library and does work when not using NPM link and instead using the deployed version. Is there an extra step I am missing to include the dependencies in the link process, or is there an extra command I need to run?

Any suggestions would be much appreciated

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

爱你是孤单的心事 2025-02-20 21:19:31

我已经解决了这个问题。我解决的方式是通过在angular.json文件中添加“ PreservesyMlinks”:True

布局应该是:

"build": {
    "options": {
        "preserveSymlinks": true,
    }
},

请注意,这只是对Angular 11或更少版本的解决方案

。内角“>答案为大于11的版本提供了解决方案

I have fixed this issue. The way I resolved it was by adding "preserveSymlinks": true in the angular.json file.

The layout should be:

"build": {
    "options": {
        "preserveSymlinks": true,
    }
},

Please note, this is only a solution for versions of angular 11 or less

This answer offers a solution for versions greater than 11

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文