python ruby-programming-language Smalltalk Vue.js Knockoutjs TypeScript JavaScript, OOPs JavaScript Angular 8,7,6,5,4 and 2 Interview Questions and Answers Angular 8,7,6,5,4 and 2 Interview Questions and Answers Angular 4 Angular 2 AngularJs 1.x NodeJs Perl Programming R Programming RequireJs Rust Programming Backbonejs closure programming language go-programming-language kotlin-programming-language
cannot find module 'angular2/core'

cannot find module 'angular2/core'




In Visual Studio 2013, the configurations of typescript is little bit challenging but you can configure typescript manually easily.


Following steps as given below.

Step 1

In the Step1, right-click on your project and Unload Project.

Step 2

In the Step 2, right-click the unloaded project and edit to .csproj file.


Step 3

In the Step 3, add a PropertyGroup node in under the project node which is given below.
  <PropertyGroup Condition="'$(Configuration)' == 'Debug'">
    <TYPESCRIPTTARGET>ES5</TYPESCRIPTTARGET>
    <TYPESCRIPTJSXEMIT>NONE</TYPESCRIPTJSXEMIT>
    <TYPESCRIPTCOMPILEONSAVEENABLED>TRUE</TYPESCRIPTCOMPILEONSAVEENABLED>
    <TYPESCRIPTNOIMPLICITANY>FALSE</TYPESCRIPTNOIMPLICITANY>
    <TYPESCRIPTMODULEKIND>COMMONJS</TYPESCRIPTMODULEKIND>
    <TYPESCRIPTREMOVECOMMENTS>FALSE</TYPESCRIPTREMOVECOMMENTS>
    <TYPESCRIPTOUTFILE />
    <TYPESCRIPTOUTDIR />
    <TYPESCRIPTGENERATESDECLARATIONS>FALSE</TYPESCRIPTGENERATESDECLARATIONS>
    <TYPESCRIPTNOEMITONERROR>TRUE</TYPESCRIPTNOEMITONERROR>
    <TYPESCRIPTSOURCEMAP>TRUE</TYPESCRIPTSOURCEMAP>
    <TYPESCRIPTMAPROOT />
    <TYPESCRIPTSOURCEROOT />
    <TYPESCRIPTEXPERIMENTALDECORATORS>TRUE</TYPESCRIPTEXPERIMENTALDECORATORS>
  </PROPERTYGROUP>

     OR

  <PropertyGroup Condition="'$(Configuration)' == 'Release'">
    <TypeScriptTarget>ES5</TypeScriptTarget>
    <TypeScriptJSXEmit>None</TypeScriptJSXEmit>
    <TypeScriptCompileOnSaveEnabled>True</TypeScriptCompileOnSaveEnabled>
    <TypeScriptNoImplicitAny>False</TypeScriptNoImplicitAny>
    <TypeScriptModuleKind>System</TypeScriptModuleKind>
    <TypeScriptRemoveComments>False</TypeScriptRemoveComments>
    <TypeScriptOutFile />
    <TypeScriptModuleResolution>NodeJs</TypeScriptModuleResolution>
    <TypeScriptOutDir />
    <TypeScriptGeneratesDeclarations>False</TypeScriptGeneratesDeclarations>
    <TypeScriptNoEmitOnError>True</TypeScriptNoEmitOnError>
    <TypeScriptSourceMap>True</TypeScriptSourceMap>
    <TypeScriptMapRoot />
    <TypeScriptSourceRoot />
    <TypeScriptEmitDecoratorMetadata>True</TypeScriptEmitDecoratorMetadata>
    <TypeScriptExperimentalDecorators>True</TypeScriptExperimentalDecorators>
  </PropertyGroup>

Step 4

In Step 4, right-click on unloaded project and reload to unload project.

Step 5

In Step 5, re-build your project now.

Notes :  

If you still facing same error, restart you visual studio web project.

If you are using Visual Studio 2015, you don't need to edit ".csproject" file, you could directly change in "tsconfig.json"(typescript configuration) file by adding "emitDecoratorMetadata: true".


I think, I might help you!

            
ANIL SINGH

Hi there! Welcome to my blog. My name is Anil Singh. I'm a author of this blog. For more detail about me, kindly refer to this link..
My Blogs - http://code-sample.com and http://code-sample.xyz
My Books - Interview Questions and Answers Books- Get Your Book in 15+ Digital Stores Worldwide..

You Might Also Like
www.code-sample.com/. Powered by Blogger.
ASK Questions