[英]Typescript path in VS code
I can't get typescript paths to work for VS Code in an Angular cli project. 我无法在Angular cli项目中获取VS Code工作的打字稿路径。
If you look at https://github.com/gatimus/multiple-test/blob/master/src/app1/app/app.module.ts#L3 throws 如果你看一下https://github.com/gatimus/multiple-test/blob/master/src/app1/app/app.module.ts#L3 throws
[ts] Cannot find module 'shared/shared.module',
[ts]无法找到模块'shared / shared.module',
even though path is set in tsconfig.app.json
and settings.json
has the line 即使在
tsconfig.app.json
settings.json
了路径, settings.json
也有该行
"typescript.tsdk": "node_modules/typescript/lib/"
Update: It seems the apps run but VS Code can't find the module. 更新:似乎应用程序运行但VS Code无法找到该模块。 I have version 1.16.1
我有1.16.1版
Renaming tsconfig.app.json
to tsconfig.json
and updating .angular-cli.json
seems to work. 将
tsconfig.app.json
重命名为tsconfig.json
并更新.angular-cli.json
似乎有效。
I am curious though, if the tsconfig file wasn't configurable in angular cli, how would you tell VS Code to use tsconfig.app.json
? 我很好奇,如果tsconfig文件在angular cli中不可配置,你怎么告诉VS Code使用
tsconfig.app.json
?
For anyone still struggling with this, I was having this problem in Atom and it was fixed by following the sym link. 对于仍在努力解决这个问题的人,我在Atom中遇到了这个问题,并且通过遵循sym链接来修复它。 (cmnd/ctrl click on the module name that throws the error).
(cmnd / ctrl单击抛出错误的模块名称)。 This seems to suggest that it is an issue with the IDE and not angular.
这似乎表明它是IDE的一个问题,而不是角度。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.