我创建了一个新的Angular 应用程序(v15.2.0),并添加了@ngxs/store(v3.7.6) 详细的Package.lock可以在这里看到

{
  ...
  "dependencies": {
    "@angular/animations": "^15.2.0",
    "@angular/common": "^15.2.0",
    "@angular/compiler": "^15.2.0",
    "@angular/core": "^15.2.0",
    "@angular/forms": "^15.2.0",
    "@angular/platform-browser": "^15.2.0",
    "@angular/platform-browser-dynamic": "^15.2.0",
    "@angular/router": "^15.2.0",
    "@ng-bootstrap/ng-bootstrap": "^14.0.1",
    "@ngxs/store": "^3.7.6", <-- added by me
    "ngx-cookie-service": "^15.0.0", <-- added by me
    "font-awesome": "^4.7.0", <-- added by me
    "bootstrap": "^5.2.3", <-- added by me
    "rxjs": "~7.8.0",
    "tslib": "^2.3.0",
    "zone.js": "~0.12.0"
  },
  "devDependencies": { <-- all ar the default ones
    "@angular-devkit/build-angular": "^15.2.1",
    "@angular/cli": "~15.2.1",
    "@angular/compiler-cli": "^15.2.0",
    "@types/jasmine": "~4.3.0",
    "jasmine-core": "~4.5.0",
    "karma": "~6.4.0",
    "karma-chrome-launcher": "~3.1.0",
    "karma-coverage": "~2.2.0",
    "karma-jasmine": "~5.1.0",
    "karma-jasmine-html-reporter": "~2.0.0",
    "typescript": "~4.9.4"
  }
}

NPM I运行良好:

$ npm i
npm WARN deprecated @npmcli/move-file@2.0.1: This functionality has been moved to @npmcli/fs

added 912 packages, and audited 913 packages in 34s

94 packages are looking for funding
  run 'npm fund' for details

found 0 vulnerabilities

但当我启动NPM时,我会得到这样的结果:

$ npm start
...

./node_modules/@ngxs/store/__ivy_ngcc__/fesm2015/ngxs-store.js:2667:6-17 - Error: export 'ɵivyEnabled' (imported as 'ɵivyEnabled') was not found in '@angular/core' (possible exports: ANALYZE_FOR_ENTRY_COMPONENTS, ANIMATION_MODUL
E_TYPE, APP_BOOTSTRAP_LISTENER, APP_ID, APP_INITIALIZER, ApplicationInitStatus, ApplicationModule, ApplicationRef, Attribute, COMPILER_OPTIONS, CUSTOM_ELEMENTS_SCHEMA, ChangeDetectionStrategy, ChangeDetectorRef, Compiler, Compil
i18nStart, ɵɵinject, ɵɵinjectAttribute, ɵɵinvalidFactory, ɵɵinvalidFactoryDep, ɵɵlistener, ɵɵloadQuery, ɵɵnamespaceHTML, ɵɵnamespaceMathML, ɵɵnamespaceSVG, ɵɵnextContext, ɵɵngDeclareClassMetadata, ɵɵngDeclareComponent, ɵɵngDeclareDirective, ɵɵngDeclareFactory, ɵɵngDeclareInjectable, ɵɵngDeclareInjector, ɵɵngDeclareNgModule, ɵɵngDeclarePipe, ɵɵpipe, ɵɵpipeBind1, ɵɵpipeBind2, ɵɵpipeBind3, ɵɵpipeBind4, ɵɵpipeBindV, ɵɵprojection, ɵɵprojectionDef, ɵɵproperty, ɵɵpropertyInterpolate, ɵɵpropertyInterpolate1, ɵɵpropertyInterpolate2, ɵɵpropertyInterpolate3, ɵɵpropertyInterpolate4, ɵɵpropertyInterpolate5, ɵɵpropertyInterpolate6, ɵɵpropertyInterpolate7, ɵɵpropertyInterpolate8, ɵɵpropertyInterpolateV, ɵɵpureFunction0, ɵɵpureFunction1, ɵɵpureFunction2, ɵɵpureFunction3, ɵɵpureFunction4, ɵɵpureFunction5, ɵɵpureFunction6, ɵɵpureFunction7, ɵɵpureFunction8, ɵɵpureFunctionV, ɵɵqueryRefresh, ɵɵreference, ɵɵregisterNgModuleType, ɵɵresetView, ɵɵresolveBody, ɵɵresolveDocument, ɵɵresolveWindow, ɵɵrestoreView, ɵɵsanitizeHtml, ɵɵsanitizeResourceUrl, ɵɵsanitizeScript, ɵɵsanitizeStyle, ɵɵsanitizeUrl, ɵɵsanitizeUrlOrResourceUrl, ɵɵsetComponentScope, ɵɵsetNgModuleScope, ɵɵstyleMap, ɵɵstyleMapInterpolate1, ɵɵstyleMapInterpolate2, ɵɵstyleMapInterpolate3, ɵɵstyleMapInterpolate4, ɵɵstyleMapInterpolate5, ɵɵstyleMapInterpolate6, ɵɵstyleMapInterpolate7, ɵɵstyleMapInterpolate8, ɵɵstyleMapInterpolateV, ɵɵstyleProp, ɵɵstylePropInterpolate1, ɵɵstylePropInterpolate2, ɵɵstylePropInterpolate3, ɵɵstylePropInterpolate4, ɵɵstylePropInterpolate5, ɵɵstylePropInterpolate6, ɵɵstylePropInterpolate7, ɵɵstylePropInterpolate8, ɵɵstylePropInterpolateV, ɵɵsyntheticHostListener, ɵɵsyntheticHostProperty, ɵɵtemplate, ɵɵtemplateRefExtractor, ɵɵtext, ɵɵtextInterpolate, ɵɵtextInterpolate1, ɵɵtextInterpolate2, ɵɵtextInterpolate3, ɵɵtextInterpolate4, ɵɵtextInterpolate5, ɵɵtextInterpolate6, ɵɵtextInterpolate7, ɵɵtextInterpolate8, ɵɵtextInterpolateV, ɵɵtrustConstantHtml, ɵɵtrustConstantResourceUrl, ɵɵvalidateIframeAttribute, ɵɵviewQuery)


× Failed to compile.

我如何用ngxs修复这个错误?没有它,一切都很好,但我的应用程序中需要ngx.我还有另一款ANGLE应用程序,它具有相同的依赖关系,但使用的是ANGLE v14. 有什么主意吗?

将Angular 从v15降级到v14,它起作用了,但我必须使用Angular 15

推荐答案

试试15.0.2度角 对我来说工作很好,你可以用15号角

Angular相关问答推荐

有没有一种方法用timeout()操作符创建计数器,用于超时一个观察对象?

将Angular 17中的http服务与独立组件一起使用

Angular 服务错误处理响应类型=BLOB

父母和子元素在17号角不保持同步

筛选器不会从文本输入触发更改事件

Angular 16模块中未使用的组件是否从Bundle 包中删除(树摇动)?

Angular 懒惰地加载一个服务

使用 Angular 类构造函数来获取依赖项

MAT折叠面板的动态开启和关闭无法工作

如何在 Angular 中顺序执行回调

有没有办法订阅部分 BehaviorSubject 值的变化?

可观察的等待直到另一个可观察的值

Angular 从 13.3.8 恢复到 13.3.7

个人修改 Angular CLI - 创建新应用

在 angular2 中,如何获取在为 @Input 发送的对象上更改的属性的 onChanges

Angular2:更新数组时*ngFor不更新

更改 Select 选项时获取当前值

Angularmaterial步进器:禁用标题导航

Angular 2 应用程序中没有Access-Control-Allow-Origin标头

具有多个订阅者的 Angular 2 Observable