gpt4 book ai didi

typescript - 除非提供 '--module' 标志,否则无法编译模块

转载 作者:搜寻专家 更新时间:2023-10-30 21:20:34 25 4
gpt4 key购买 nike

<分区>

我有 typescript 1.5.3 和 visual studio 2015。

我在 typescript 中使用了外部模块,但由于以下错误而无法构建:“构建:除非提供‘--module’标志,否则无法编译模块。”

typescript 设置:

<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|Any CPU'">
<TypeScriptTarget>ES5</TypeScriptTarget>
<TypeScriptCompileOnSaveEnabled>True</TypeScriptCompileOnSaveEnabled>
<TypeScriptNoImplicitAny>False</TypeScriptNoImplicitAny>
<TypeScriptModuleKind>AMD</TypeScriptModuleKind>
<TypeScriptRemoveComments>False</TypeScriptRemoveComments>
<TypeScriptOutFile />
<TypeScriptOutDir />
<TypeScriptGeneratesDeclarations>False</TypeScriptGeneratesDeclarations>
<TypeScriptNoEmitOnError>True</TypeScriptNoEmitOnError>
<TypeScriptSourceMap>True</TypeScriptSourceMap>
<TypeScriptMapRoot />
<TypeScriptSourceRoot />

模块:

export class Functions {
errorHelper(xhr: any, errorType: any, exception?: any) {
var errorMessage = exception || xhr.statusText;
alert(`Account lookup failed. ${errorMessage}`);
}

getParameterByName(name: string) {
name = name.replace(/[\[]/, '\\[').replace(/[\]]/, '\\]');
var regex = new RegExp(`[\?&]${name}=([^&#]*)`);
var results = regex.exec(location.search);
return results === null ? '' : decodeURIComponent(results[1].replace(/\+/g, ' '));
}

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com