Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angular/26.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何让atom typescript识别没有相对路径的模块?_Typescript_Angular_Atom Editor_Angular Meteor_Tsconfig - Fatal编程技术网

如何让atom typescript识别没有相对路径的模块?

如何让atom typescript识别没有相对路径的模块?,typescript,angular,atom-editor,angular-meteor,tsconfig,Typescript,Angular,Atom Editor,Angular Meteor,Tsconfig,我跟在后面 因为我使用的是atom,所以我添加了atom typescript包和一个tsconfig文件来利用类型声明文件 我正试图让atom typescript识别客户端/参与方表单/parties\u表单.ts上的导入: import {Parties} from 'collections/parties'; 但是atom给了我以下错误:找不到模块“集合/参与方”。 导入具有相对路径的模块时出错: import {Parties} from '../../collections/pa

我跟在后面

因为我使用的是atom,所以我添加了atom typescript包和一个
tsconfig
文件来利用类型声明文件

我正试图让atom typescript识别
客户端/参与方表单/parties\u表单.ts上的导入:

import {Parties} from  'collections/parties';
但是atom给了我以下错误:
找不到模块“集合/参与方”。

导入具有相对路径的模块时出错:

import {Parties} from '../../collections/parties';
但是meteor不会编译,并给我一个
路径保留冲突
错误

我希望能够使用第一种导入,而不让atom typescript给我任何错误,从而识别我的类型声明文件。我错过了什么

我的
tsconfig.json
文件:

{
    "version": "1.5.0",
    "compilerOptions": {
        "target": "es5",
        "module": "commonjs",
        "declaration": false,
        "noImplicitAny": false,
        "removeComments": true,
        "noLib": false,
        "emitDecoratorMetadata": true
    },
    "filesGlob": [
        "./**/*.ts",
        "!./typings/**/*.ts"
    ]
}
可以找到教程代码的完整版本

从“../../collections/Parties”导入{Parties}


此要求不特定于atom typescript。TypeScript不支持您自己的代码在节点_模块之外的非相对路径。跟踪此问题以了解详细信息:

我有处理导入的Web包,是否有任何方法可以在atom中抑制该错误消息(我的应用程序运行良好,因此它不是真正的错误)在编译器设置中使用TypeScript的“baseUrl”选项。例如,如果您的代码位于
src
“baseUrl”:“/src”
Oops!还需要添加
“rootDirs”:[“/src”]