Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

TS2307: Cannot find module 'ionic/ionic'

When trying to use tsc with my ionic2 project, i am getting the following error on a typescript file.

The Error: TS2307: Cannot find module 'ionic/ionic'


The Code:

import {Page} from "ionic/ionic" //error happens on this line

@Page({
  templateUrl: 'app/list/list.html',
})
export class ListPage {
  constructor() {}
}

My tsconfig.json file:

{
  "compilerOptions": {
    "target": "ES5",
    "module": "commonjs",
    "sourceMap": true,
    "isolatedModules": true,
    "noEmitOnError": false,
    "rootDir": ".",
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true
  },
  "compileOnSave": false
}

My npm -g list:

[email protected]
[email protected]
[email protected]
[email protected]
like image 393
prolink007 Avatar asked Nov 21 '15 03:11

prolink007


2 Answers

See issue 84

We still need to create a definition file for ionic 2. So until then, the typescript compiler will yell a lot, but it will still compile the code correctly.

like image 82
mhartington Avatar answered Nov 17 '22 04:11

mhartington


This seems to have been resolved in "ionic-framework": "2.0.0-alpha.38".

like image 20
prolink007 Avatar answered Nov 17 '22 05:11

prolink007