离子2构建或运行时出错 [英] Error in ionic 2 build or run

查看:92
本文介绍了离子2构建或运行时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试运行以下命令但是给我下面的打字稿模块错误:

I am trying to run below command but gives me typescript module error like below:


ionic cordova run android
Error: Cannot find module 'typescript'


请帮我摆脱这个!

以下是我的无效信息输出:

Below is my inoic info output:

ionic info

cli包:(/ usr / local / lib / node_modules)

cli packages: (/usr/local/lib/node_modules)

@ionic/cli-utils  : 1.9.2
ionic (Ionic CLI) : 3.9.2

全球套餐:

Cordova CLI : 7.0.1 
Gulp CLI    : CLI version 1.2.2 Local version 3.9.1

本地套餐:

@ionic/app-scripts : 2.1.4
Cordova Platforms  : android 6.2.3 ios 4.4.0
Ionic Framework    : ionic-angular 3.6.0

系统:

Android SDK Tools : 25.2.5
Node              : v8.4.0
npm               : 5.2.0 
OS                : Linux 3.13

下面是我的package.json:

Below is my package.json:

 {
  "name": "ionic-hello-world",
  "version": "0.0.0",
  "author": "Ionic Framework",
  "homepage": "http://ionicframework.com/",
  "private": true,
  "scripts": {
    "clean": "ionic-app-scripts clean",
    "build": "ionic-app-scripts build",
    "lint": "ionic-app-scripts lint",
    "ionic:build": "ionic-app-scripts build",
    "ionic:serve": "ionic-app-scripts serve"
  },
  "dependencies": {
    "@angular/common": "4.1.3",
    "@angular/compiler": "4.1.3",
    "@angular/compiler-cli": "4.1.3",
    "@angular/core": "4.1.3",
    "@angular/forms": "4.1.3",
    "@angular/http": "4.1.3",
    "@angular/platform-browser": "4.1.3",
    "@angular/platform-browser-dynamic": "4.1.3",
    "@ionic-native/camera": "^4.2.1",
    "@ionic-native/core": "3.12.1",
    "@ionic-native/geolocation": "^4.2.1",
    "@ionic-native/keyboard": "^4.1.0",
    "@ionic-native/splash-screen": "3.12.1",
    "@ionic-native/sqlite": "^4.2.1",
    "@ionic-native/status-bar": "3.12.1",
    "@ionic/storage": "2.0.1",
    "ionic-angular": "3.6.0",
    "ionicons": "3.0.0",
    "rxjs": "5.4.0",
    "sw-toolbox": "3.6.0",
    "typescript": "^2.5.2",
    "zone.js": "0.8.12"
  },
  "devDependencies": {
    "@ionic/app-scripts": "^2.1.4"
  },
  "cordovaPlugins": [
    "cordova-plugin-whitelist",
    "cordova-plugin-console",
    "cordova-plugin-statusbar",
    "cordova-plugin-device",
    "ionic-plugin-keyboard",
    "cordova-plugin-splashscreen"
  ],
  "cordovaPlatforms": [],
  "description": "checkCookieApp: An Ionic project"
}

这是我的package.js正在运行的文件 npm install

This is my package.json file using which I am running npm install

推荐答案

这个问题得到了解决方法是安装打字脚本\ n

This issue got solved by installing typing-script \n "


npm install -g tsd

npm install -g tsd

创建新的离子2项目并在下面运行 -

And creating new ionic 2 project and running below -


ionic cordova run android

ionic cordova run android

在同一节点8.4.0版本上适用于我。

Works for me on same node 8.4.0 version.

这篇关于离子2构建或运行时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆