角度使用私人图书馆

时间:2020-10-21 21:40:08

标签: angular npm shared-libraries

我开发了一个库,然后将其发布到一个仓库中,以便可以通过npm在其他项目中使用它

除了在启动项目时出现以下错误:

#standardsql
with temp as (
  select big_id, temp_id, array_agg(names) names
  from `project.dataset.table`
  group by big_id, temp_id
)
select big_id, temp_id, names 
from (
  select big_id, temp_id, any_value(names) names 
  from (
    select t1.*,
      ( select count(1)
        from t1.names name
        join t2.names name
        using(name)
        where t1.temp_id != t2.temp_id
      ) = array_length(t1.names) as flag
    from temp t1 
    join temp t2
    using (big_id)
  )
  group by big_id, temp_id
  having countif(flag) = 0
), unnest(names) names    

我的图书馆有以下依赖关系:

ERROR in Cannot resolve type entity i3.FontAwesomeModule to symbol

我在其中安装库的项目中包含一些在lib中的依赖项,但不是全部。我必须手动安装其他依赖项吗?

1 个答案:

答案 0 :(得分:0)

是的!您必须在使用库组件的项目中手动安装对等依赖项。

角度文档中提到:https://angular.io/guide/creating-libraries#use-typescript-path-mapping-for-peer-dependencies

<块引用>

在开发库时,必须通过 devDependencies 安装所有对等依赖项,以确保库正确编译。然后,链接库将拥有自己的一组用于构建的 Angular 库,位于其 node_modules 文件夹中。但是,这可能会在构建或运行您的应用程序时导致问题。

相关问题