Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ts cannot find module '@angular/platform-browser';

Images of files

**app.module.ts file**

**app.component file**

I am having this error and i am not able to figure that out.I am trying to import angular/core and angular/platform-browser . I followed many links on stackoverflow but none of them helped me out.

this is my package.json file

{   "name": "angular-2",   "version": "1.0.0",   "scripts": {
    "start": "concurrently \"npm run tsc:w\" \"npm run lite\" ",
    "tsc": "tsc",
    "tsc:w": "tsc -w",
    "lite": "lite-server",
    "typings": "typings",
    "postinstall": "typings install"   },   "license": "ISC",   "dependencies": {
    "angular2": "2.0.0-beta.13",
    "systemjs": "0.19.25",
    "es6-shim": "^0.35.0",
    "reflect-metadata": "0.1.2",
    "rxjs": "5.0.0-beta.2",
    "@angular/router":  "3.0.0-alpha.7",
    "zone.js": "0.6.6"
       },   "devDependencies": {
    "concurrently": "^2.0.0",
    "lite-server": "^2.1.0",
    "typescript": "^1.8.9",
    "typings":"^0.7.11"   } }
like image 302
Shehram Tahir Avatar asked Feb 14 '17 11:02

Shehram Tahir


1 Answers

I think you need install and add @angular/platform-browser in your package.json you can do this:

npm install @angular/platform-browser --save

So, at this moment angular2 has a final version, youi don't need to use a beta version. You tagged your project like an ionic2 project, but he doesn't seen like a normal ionic2 app, you don't have any ionic/cordova dependecy in your package.json

like image 187
Ricardo Avatar answered Oct 02 '22 19:10

Ricardo