1

I'm trying to run an Angular 2 app but the build is failing with the error "Cannot find module '@angular/core'". I've tried the following steps:

  • In VS2015 I've set my TypeScript Build > Module System to CommonJS
  • In VS2015 Tools > Options > Text Editor > TypeScript > Project has the following options checked: ** Automatically compile TypeScript files which are not part of a project, ** Use CommonJS code generation for modules that are not part of a project, ** ECMAScript version for files that are not part of a project = ECMAScript6
  • In tsconfig.json I've set "target" to "es6"
  • "npm list" on my website node_modules directory shows that angular1 and angular2 are installed

What do you recommend as next steps to debug?

2
  • Refer this article - angular.io/docs/ts/latest/cookbook/visual-studio-2015.html Commented Jul 22, 2016 at 16:14
  • make sure 'node_modules' is in the right location (in the project's root, sibling with wwwroot). also must show in the project Dependencies folder. I was moving files around as I was integrating the quickstart guide into a new ASP.NET Core project, and the node_modules folder was misplaced. hope this helps Commented Jan 18, 2017 at 19:38

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.