微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

npm run build 抛出错误“属性‘加载’受到保护,只能在‘AnimationState’类及其子类中访问”

如何解决npm run build 抛出错误“属性‘加载’受到保护,只能在‘AnimationState’类及其子类中访问”

我正在尝试运行此存储库 - https://github.com/alexeychikk/happy-birthday-orly。 它使用 Phaser3、节点、打字稿和 AngularJS。 虽然“npm start”在本地主机中工作正常,但当我尝试“npm run build”时出现错误,它会引发以下错误

ERROR in /home/wm0609/git_files/anu/happy-birthday-orly/src/components/Doors.ts(110,18)
  TS2445: Property 'load' is protected and only accessible within class 'AnimationState' and its subclasses.

ERROR in /home/wm0609/git_files/anu/happy-birthday-orly/src/components/LevelMap.ts(75,19)
  TS2352: Conversion of type 'Tiledobject[]' to type 'LevelObject[]' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional,convert the expression to 'unkNown' first.Type 'Tiledobject' is not comparable to type 'LevelObject'.
    Type 'Tiledobject' is missing the following properties from type 'GameObject': scene,displayList,state,parentContainer,and 41 more.

ERROR in /home/wm0609/git_files/anu/happy-birthday-orly/src/components/Doors.ts(121,17)
  TS2540: Cannot assign to 'height' because it is a read-only property.

错误 1 ​​

enter image description here

错误 2

enter image description here

我尝试在 heroku/netlify 上托管它,但同样的问题。 感谢您的帮助!

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。