Angular 解析导入(Typescript)时出错(角度)

Angular 解析导入(Typescript)时出错(角度),angular,typescript,jhipster,Angular,Typescript,Jhipster,我正在使用jHipster生成代码。我在my home.component.ts中有一个简单的导入语句: import { Account } from 'app/core/user/account.model'; // ///throws error - [ts] Cannot find module 'app/core/user/account.model'. 我的app/core/user目录中有account.model.ts文件,看起来是这样的: export cla

我正在使用jHipster生成代码。我在my home.component.ts中有一个简单的导入语句:

import { Account } from 'app/core/user/account.model'; //
        ///throws error - [ts] Cannot find module 'app/core/user/account.model'.
我的app/core/user目录中有account.model.ts文件,看起来是这样的:

export class Account {
  constructor(
    public activated: boolean,
    public authorities: string[],
    public email: string,
    public firstName: string,
    public langKey: string,
    public lastName: string,
    public login: string,
    public imageUrl: string
  ) {}
}
如果文件存在,为什么会出现此错误

(注:Angular CLI:10.0.0 节点:12.18.1 操作系统:win32 x64 角度:10.0.0
jHipster:6.10.3)

如果我放置完全限定的文件(例如C:/Users/…),我可以消除错误,但是我如何才能记住这个目录(即,为文件添加前缀)?您是否尝试过将其指定为相对路径?我必须一直指定路径,直到C:/Users/才能解析导入,当我替换为“…”时(我想这就是你所说的相对)那么它不能解析导入。介意我们看看你的tsconfig.json吗?那里应该定义baseDir和路径。请参阅。