1

OS: Windows 10 Pro
IDE: Visual Studio 2015 Community

So I've been trying to get the '5 minute quickstart' demo (https://angular.io/guide/quickstart) to work on VS 2015, without success.

I have a package.json file 'included' in my project:

{
  "name": "TypeScriptHTMLApp2",
  "version": "1.0.0",
  "description": "",
  "main": "app.ts",
  "dependencies": {
    "angular2": "2.0.0-alpha.46",
    "systemjs": "0.19.6"
  }
}

and have 'excluded' the 'node_modules' folder, because when included it was generating many duplicate error messages.

But I'm getting error TS2307 'Cannot find module 'angular2/angular2' on the following line:

import {Component, bootstrap} from "angular2/angular2";

How do I resolve this issue so as to make this demo work?

Many thanks in advance

2
  • 1
    Read this comment, it may be helpful (read the entire issue, it's interesting). Commented Nov 28, 2015 at 1:14
  • 1
    I found the solution to my question, here: stackoverflow.com/a/33183829/5613904 Commented Nov 28, 2015 at 11:29

1 Answer 1

0

you have to unload your project file and add the below line

 <PropertyGroup Condition="'$(Configuration)' == 'Debug'">
    <TypeScriptRemoveComments>false</TypeScriptRemoveComments>
    <TypeScriptSourceMap>true</TypeScriptSourceMap>
    <TypeScriptTarget>ES5</TypeScriptTarget>
    <TypeScriptJSXEmit>None</TypeScriptJSXEmit>
    <TypeScriptCompileOnSaveEnabled>True</TypeScriptCompileOnSaveEnabled>
    <TypeScriptNoImplicitAny>False</TypeScriptNoImplicitAny>
    <TypeScriptModuleKind>System</TypeScriptModuleKind>
    <TypeScriptModuleResolution>node</TypeScriptModuleResolution> <!-- THIS LINE -->
    <TypeScriptOutFile />
    <TypeScriptOutDir />
    <TypeScriptGeneratesDeclarations>False</TypeScriptGeneratesDeclarations>
    <TypeScriptExperimentalDecorators>true</TypeScriptExperimentalDecorators>
    <TypeScriptNoEmitOnError>True</TypeScriptNoEmitOnError>
    <TypeScriptMapRoot />
    <TypeScriptSourceRoot />
  </PropertyGroup> 
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.