标签: angular9

安装 npm 包时无法解决依赖树错误

尝试使用npm i命令安装 npm 包时,出现以下异常:

在此处输入图片说明

我尝试重新安装节点 js 包并将代理设置为关闭使用:

set HTTP_PROXY=
set HTTPS_PROXY=
Run Code Online (Sandbox Code Playgroud)

问题仍然存在。我做错了什么?

更新:

当我运行以下命令时:

npm install --legacy-peer-deps
Run Code Online (Sandbox Code Playgroud)

显示以下错误: 在此处输入图片说明

npm angularjs typescript angular angular9

181
推荐指数
16
解决办法
28万
查看次数

Job name "..getProjectMetadata" does not exist

I updated my angular to v9 and when I try to go back in v8, I receive this error. I have already tried the following:

  • uninstall -global angular/cli
  • uninstall angular/cli
  • go back to my last package.json
  • delete node_module folder
  • delete repo

This error continues to show.

My stacktrace is :

An unhandled exception occurred: Job name "..getProjectMetadata" does not exist.
See angular-errors.log for further details.
Run Code Online (Sandbox Code Playgroud)

angular-errors.log :

[error] Error: Job name "..getProjectMetadata" does not exist.
    at Observable._subscribe (/Front/node_modules/@angular-devkit/core/src/experimental/jobs/simple-scheduler.js:350:23)
    at Observable._trySubscribe …
Run Code Online (Sandbox Code Playgroud)

npm angular angular8 angular9

151
推荐指数
6
解决办法
8万
查看次数

Angular 9 引入了需要加载的全局“$localize()”函数

我在新的 angular 项目设置中遇到以下错误。

已安装的软件包及其版本

错误 错误:未捕获(承诺):错误:您的应用程序或其依赖项之一似乎正在使用 i18n。Angular 9 引入了一个$localize()需要加载的全局函数。请添加import '@angular/localize';到您的 polyfills.ts 文件中。错误:您的应用程序或其依赖项之一似乎正在使用 i18n。Angular 9 引入了一个$localize()需要加载的全局函数。

注意:我来自以下。它建议回退到旧版本。 https://github.com/angular/angular/issues/32508

localization angular angular9

68
推荐指数
9
解决办法
4万
查看次数

此类通过 SomeModule -> SomeComponent 对消费者可见,但不会从顶级库入口点导出

我将所有 angular 库升级为angular 9.0.0using ng update,当我尝试构建它们时,出现以下错误。

错误:

不受支持的私有类 SomeComponent。此类通过 SomeModule -> SomeComponent 对消费者可见,但不会从顶级库入口点导出。

有人解决了这个错误吗?

angular angular-library angular9

55
推荐指数
2
解决办法
2万
查看次数

ngcc 中的错误已在 ID 为 5196 的进程中运行

当我尝试在我的项目中运行 ng serve 命令时,它会产生以下错误。

ngcc 中的错误已在 ID 为 xxxx 的进程中运行

angular9

48
推荐指数
4
解决办法
3万
查看次数

我需要在 CI 作业中缓存什么以避免每次 ngcc 重新编译?

使用 angular 9 和它的新编译引擎 IVY,我的 CI 构建时间大幅增加。这当然是因为ngcc它在许多模块上运行。

例如

Compiling @angular/core : es2015 as esm2015

Compiling @angular/common : es2015 as esm2015

...
Run Code Online (Sandbox Code Playgroud)

我以为ngcc缓存在编译的库node_modules,但我的node_modules缓存在我的CI工作,还有编的现象发生,所以这是不可能的。

我应该缓存什么路径以避免ngcc在每次构建时重新编译所有模块?

continuous-integration circleci angular angular-ivy angular9

45
推荐指数
1
解决办法
1959
查看次数

Angular 9 - 目标入口点缺少依赖项

我已将一个 Angular 库升级到 Angular 9。但是,当我尝试在另一个 Angular 9 项目中使用该库时,我收到如下错误:

目标入口点“mycomponents/entity-selector”缺少依赖项:

 - mycomponents/shared-services
 - mycomponents/spinner
 - mycomponents/text-input
Run Code Online (Sandbox Code Playgroud)

包.json

{
  "$schema": "../../../node_modules/ng-packagr/package.schema.json",
  "name": "entity-selector",
  "version": "0.0.0",
  "ngPackage": {
    "lib": {
      "entryFile": "public_api.ts"
    },
    "dest": "../../../dist/mycomponents/entity-selector"
  }
}
Run Code Online (Sandbox Code Playgroud)

这是一个次要终点,它使用其他也是次要终点的组件。

在库项目中,我是否需要在 ng-packgr 或其他地方定义依赖项?实体选择器组件的模块为其他组件导入相应的模块。这个问题从 Angular 9 开始就出现了。

预先感谢。

angular angular9

44
推荐指数
4
解决办法
4万
查看次数

未捕获的类型错误:无法将对象转换为原始值(zone-evergreen.js:171)

Angular 9(使用 Bootstrap 4 和 Jquery 3.5.1)中。单击引导程序折叠按钮时,我在浏览器控制台而不是下拉菜单上收到错误消息。

我真的不知道错误究竟来自哪里。

Can't convert object to primitive value(zone-evergreen:171).


Uncaught Type Error: Cannot convert object to primitive value(zone-evergreen.js:171 )
    at RegExp.test (<anonymous>)
    at HTMLDivElement.<anonymous> (bootstrap.bundle.min.js:6)
    at Function.each (jquery.min.js:2)
    at S.fn.init.each (jquery.min.js:2)
    at S.fn.init.a._jQueryInterface [as collapse] (bootstrap.bundle.min.js:6)
    at HTMLDivElement.<anonymous> (bootstrap.bundle.min.js:6)
    at Function.each (jquery.min.js:2)
    at S.fn.init.each (jquery.min.js:2)
    at HTMLButtonElement.<anonymous> (bootstrap.bundle.min.js:6)
    at HTMLDocument.dispatch (jquery.min.js:2)
Run Code Online (Sandbox Code Playgroud)

bootstrap-4 angular9

41
推荐指数
1
解决办法
2万
查看次数

TimeoutException:Angular CLI 进程没有在 0 秒的超时时间内开始侦听请求

升级到 angular 9 后出现此错误。我使用的是 Visual Studio 2019,带有 angular 的 ASP .NET 核心。即使我创建新项目并将 angular 更新为 9 版本,它也会停止工作。

页面响应的完整列表是:

TimeoutException:Angular CLI 进程没有在 0 秒的超时时间内开始侦听请求。检查日志输出以获取错误信息。Microsoft.AspNetCore.SpaServices.Extensions.Util.TaskTimeoutExtensions.WithTimeout(Task task, TimeSpan timeoutDelay, string message) Microsoft.AspNetCore.SpaServices.Extensions.Proxy.SpaProxy.PerformProxyRequest(HttpContext context, HttpClient httpClient, Task baseUriTask, CancellationToken applicationStoppingToken, bool proxy404s) Microsoft.AspNetCore.Builder.SpaProxyingExtensions+<>c__DisplayClass2_0+<b__0>d.MoveNext() Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context)

我的 package.json 是:

{
  "name": "webapplication10",
  "version": "0.0.0",
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build",
    "build:ssr": "ng run WebApplication10:server:dev",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e"
  },
  "private": true,
  "dependencies": {
    "@angular/animations": "9.0.0",
    "@angular/cdk": "~9.0.0", …
Run Code Online (Sandbox Code Playgroud)

c# asp.net-core angular visual-studio-2019 angular9

34
推荐指数
8
解决办法
4万
查看次数

“在非 ES5 类上调用 getInternalNameOfClass() 中的错误:预期 AngularFireModule 具有内部类声明”

Terminal -

    "WARNING in Invalid constructor parameter decorator in D:/New folder/SilverLife/node_modules/@angular/fire/fesm2015/angular-fire.js:
     () => [
        { type: Object, decorators: [{ type: Inject, args: [PLATFORM_ID,] }] }
    ]
    
    ERROR in getInternalNameOfClass() called on a non-ES5 class: expected
    AngularFireModule to have an inner class declaration"
Run Code Online (Sandbox Code Playgroud)

在我的 Angular 9 项目中集成 Angular firebase 时,我遇到了这个问题。 我的应用程序的 package.json

firebase angularfire angular angular9

33
推荐指数
2
解决办法
3万
查看次数