升级到离子v2.0.0问题 [英] Upgrading to ionic v2.0.0 issues

查看:146
本文介绍了升级到离子v2.0.0问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的项目最初是使用以下方式构建的:

My project was originally built using:


  • ionic:2.0.0-rc.3

  • ionic-app-scripts:0.0.45

  • ionic: 2.0.0-rc.3
  • ionic-app-scripts: 0.0.45

升级到:


  • ionic:2.0.0 (看起来像 2.0.0-rc.6

  • ionic-app-scripts:1.0.0

  • ionic: 2.0.0 (which just looks like 2.0.0-rc.6)
  • ionic-app-scripts: 1.0.0

我遇到很多错误:

我查看了 ionic 更改日志 ionic-app-scripts 一个但没有什么突出的。

I've reviewed the ionic changelog and the ionic-app-scripts one but nothing stands out.

我假设错误要做使用 ionic-app-scripts (因为这是 node_modules 中的目录)它正在查看但我不确定它是什么。

I'm assuming the errors are to do with ionic-app-scripts (as that's the directory in node_modules) it's looking at but I'm not sure what it could be.

当运行离子信息

Cordova CLI: 6.5.0
Ionic Framework Version: 2.0.0
Ionic CLI Version: 2.2.1
Ionic App Lib Version: 2.2.0
Ionic App Scripts Version: 1.0.0
ios-deploy version: Not installed
ios-sim version: Not installed
OS: Windows 10
Node Version: v7.4.0
Xcode version: Not installed

编辑:

这是我的 package.json

"dependencies": {
    "@angular/common": "2.4.5",
    "@angular/compiler": "2.4.5",
    "@angular/compiler-cli": "2.4.5",
    "@angular/core": "2.4.5",
    "@angular/forms": "2.4.5",
    "@angular/http": "2.4.5",
    "@angular/platform-browser": "2.4.5",
    "@angular/platform-browser-dynamic": "2.4.5",
    "@angular/platform-server": "2.4.5",
    "@ionic/storage": "1.1.7",
    "@types/jasmine": "^2.5.40",
    "@types/lodash": "^4.14.50",
    "angular2-google-maps": "0.17.0",
    "angularfire2": "^2.0.0-beta.6",
    "clean-css": "^4.0.2",
    "firebase": "^3.6.4",
    "ionic-angular": "2.0.0",
    "ionic-native": "2.4.1",
    "ionicons": "3.0.0",
    "lodash": "^4.17.4",
    "rxjs": "^5.0.0-beta.12",
    "zone.js": "0.7.6"
},
"devDependencies": {
    "@ionic/app-scripts": "1.0.0",
    "typescript": "2.1.5"
},

编辑#2:

如果我将 packages.json 从工作模板复制到我的项目(并重新安装 node_modules 我得到了和以前一样的错误。这显然是 @ ionic / app-scripts 的错误,因为我已经运行 npm run build (如描述了这里这就是错误的地方(s出现。

If I copy the packages.json from a working template to my project (and do a fresh install of node_modules) I get the same error as before. It is clearly an error with @ionic/app-scripts as I have run npm run build (as described here) and that's where the error(s) appear.

由于错误仅在我复制到 src 文件夹中时出现,因此必须是与我的项目有关,因为它是用 0.0.45 写的,而不是 1.0.0 @离子/应用的脚本。有没有可能的方法来调试并找到错误的位置?

Since the error(s) only came when I copied in my src folder, it must be something to with my project as it was written with 0.0.45 and not 1.0.0 of @ionic/app-scripts. Is there a possible way to debug and find where the error is?

此外(即使开箱即用的模板有效),进入 clean-css-factory.d.ts virtual-file-utils.d.ts ,即使它有相同的错误构建并运行得很好?

Also (even though the out-the-box template works), when going into clean-css-factory.d.ts and virtual-file-utils.d.ts, the same errors are there even though it builds and runs just fine?

注意:运行 npm run build 时,控制台记录到:

Note: When running npm run build, the console logs up until:

> ionic-hello-world@ build   E:\Documents\Year_3\Mobile_Application_Development\mammoth-v2
> ionic-app-scripts build

[15:41:38]  ionic-app-scripts 1.0.0
[15:41:38]  build dev started ...
[15:41:38]  clean started ...
[15:41:38]  clean finished in 3 ms
[15:41:38]  copy started ...
[15:41:38]  transpile started ...

            **errors occur from here**

解决方案:

我找到了原始问题的解决方案。有一个未使用的模块已导致不再存在(由于新版本的 @ ionic / app-scripts ,它是:

I have found a solution to the original problem. There was an unused import of a module that no longer exists (due to the new version of @ionic/app-scripts) which was:


从@ ionic / app-scripts / dist导入{transformSrcPathToTmpPath};


推荐答案

解决方案是我有一个未使用的导入,在<$ c中查找模块$ c> @ ionic / app-scripts 不再存在(来自 0.0.45 ,并且不存在于 1.0.0
它所寻找的模块是 transformSrcPathToTmpPath in @ ionic / app-scripts / dist

The solution was that I had an unused import looking for a module in @ionic/app-scripts that no longer existed (was from 0.0.45 and doesn't exist in 1.0.0).
The module it was looking for was transformSrcPathToTmpPath in @ionic/app-scripts/dist

这篇关于升级到离子v2.0.0问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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