打字稿 – TS2307:找不到模块’离子/离子’
发布时间:2020-12-17 06:58:41 所属栏目:安全 来源:网络整理
导读:当我尝试在我的ionic2项目中使用tsc时,我在打字稿文件上收到以下错误. 错误: TS2307:找不到模块’离子/离子’ 代码: import {Page} from "ionic/ionic" //error happens on this line@Page({ templateUrl: 'app/list/list.html',})export class ListPage
当我尝试在我的ionic2项目中使用tsc时,我在打字稿文件上收到以下错误.
错误: 代码: import {Page} from "ionic/ionic" //error happens on this line @Page({ templateUrl: 'app/list/list.html',}) export class ListPage { constructor() {} } 我的tsconfig.json文件: { "compilerOptions": { "target": "ES5","module": "commonjs","sourceMap": true,"isolatedModules": true,"noEmitOnError": false,"rootDir": ".","emitDecoratorMetadata": true,"experimentalDecorators": true },"compileOnSave": false } 我的npm -g列表: cordova@5.4.0 ionic@2.0.0-alpha.23 npm@3.4.1 typescript@1.6.2 解决方法
见
issue 84
我们仍然需要为离子2创建一个定义文件.所以在那之前,typescript编译器会大喊大叫,但它仍然会正确编译代码. (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |