首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >将我的Angular项目从5x升级到6x后的问题

将我的Angular项目从5x升级到6x后的问题
EN

Stack Overflow用户
提问于 2019-02-08 18:53:59
回答 1查看 76关注 0票数 0

我刚刚按照通常的指南将我的Angular 5项目升级到了6。我已经更新了我的软件包,还安装了rxjs-compat软件包,并运行以下命令从rxjs 5迁移到rxjs 6

代码语言:javascript
复制
npm install -g rxjs-tslint

npm install rxjs-compat --save

rxjs-5-to-6-migrate -p tsconfig.json

我的package.json如下所示

代码语言:javascript
复制
{
  "name": "srm-portal",
  "version": "1.0.0",
  "description": "",
  "main": "wwwroot/index.html",
  "author": "",
  "license": "ISC",
  "scripts": {
    "ngc": "ngc -p ./tsconfig-aot.json",
    "start": "concurrently \"webpack-dev-server --hot --inline --port 8080\" \"dotnet run\" ",
    "webpack-dev": "set NODE_ENV=development && webpack",
    "webpack-production": "set NODE_ENV=production && webpack",
    "build-dev": "npm run webpack-dev",
    "build-production": "npm run ngc && npm run webpack-production",
    "watch-webpack-dev": "set NODE_ENV=development && webpack --watch --color",
    "watch-webpack-production": "npm run build-production --watch --color",
    "publish-for-iis": "npm run build-production && dotnet publish -c Release"
  },
  "dependencies": {
    "@angular/animations": "^6.0.0",
    "@angular/common": "^6.0.0",
    "@angular/compiler": "^6.0.0",
    "@angular/compiler-cli": "^6.0.0",
    "@angular/core": "^6.0.0",
    "@angular/forms": "^6.0.0",
    "@angular/http": "^6.0.0",
    "@angular/platform-browser": "^6.0.0",
    "@angular/platform-browser-dynamic": "^6.0.0",
    "@angular/platform-server": "^6.0.0",
    "@angular/router": "^6.0.0",
    "@angular/upgrade": "~4.3.0",
    "angular-in-memory-web-api": "0.3.2",
    "angular2-chartjs": "^0.2.0",
    "angular2-notifications": "^0.7.4",
    "angular2-redux": "^4.0.0",
    "core-js": "2.5.6",
    "date-input-polyfill": "^2.14.0",
    "font-awesome": "4.7.0",
    "ie-shim": "~0.1.0",
    "linkifyjs": "^2.1.4",
    "ng2-appinsights": "^1.0.0-beta.1",
    "ng2-currency-mask": "^4.3.1",
    "ng2-dnd": "^4.2.0",
    "ng2-toasty": "^4.0.3",
    "ng2-validation": "^4.2.0",
    "ngx-chips": "1.5.3",
    "ngx-easy-table": "2.2.0",
    "ngx-pagination": "3.0.3",
    "powerbi-client": "^2.4.7",
    "primeicons": "^1.0.0-beta.10",
    "primeng": "^6.1.2",
    "redux": "^3.6.0",
    "redux-thunk": "^2.2.0",
    "reflect-metadata": "0.1.10",
    "rxjs": "^6.1.0",
    "rxjs-compat": "^6.4.0",
    "zone.js": "0.8.26"
  },
  "devDependencies": {
    "@types/node": "10.0.6",
    "angular-router-loader": "^0.6.0",
    "angular2-template-loader": "0.6.2",
    "awesome-typescript-loader": "3.1.2",
    "clean-webpack-plugin": "^0.1.16",
    "copy-webpack-plugin": "^4.0.1",
    "css-loader": "^0.28.0",
    "file-loader": "^0.11.1",
    "html-webpack-plugin": "^2.28.0",
    "json-loader": "^0.5.4",
    "node-sass": "^4.5.3",
    "raw-loader": "^0.5.1",
    "sass-loader": "^6.0.3",
    "source-map-loader": "^0.2.1",
    "style-loader": "^0.16.1",
    "ts-helpers": "^1.1.2",
    "tslint": "^5.1.0",
    "tslint-loader": "^3.5.2",
    "typescript": "2.7.2",
    "url-loader": "^0.5.8",
    "webpack": "^2.4.1",
    "webpack-dev-server": "2.4.2"
  },
  "-vs-binding": {
    "ProjectOpened": [
      "watch-webpack-dev"
    ]
  }
}

我使用的是Visual Studio 2017,错误列表中显示了一些错误

还有没有人能提供进一步的帮助和建议?

请参阅所附图片

Types.d.ts error http service api error

我的项目属性如下所示

Project Properties

EN

回答 1

Stack Overflow用户

发布于 2019-02-08 19:51:20

我曾经遇到过类似的问题,因为我的angular应用程序是ASP.NET项目的一部分。在这个项目中,我还使用了typescript,但使用了不同的(旧)版本。检查您的项目属性:

我在.csproj文件中添加了一个目标,以忽略我的angular应用程序目录中的typescript。

代码语言:javascript
复制
  <Target Name="RemoveClientAppTsConfig" AfterTargets="FindConfigFiles">
    <ItemGroup>
      <ConfigFiles Remove="ClientApp/**" />
    </ItemGroup>
    <Message Importance="high" Text="remove all tsconfig.json under ClientApp" />
  </Target>

我将angular应用程序(ClientApp)添加到用于ASP.NET项目的tsconfig.json中的excludes中(而不是在angular应用程序的tsconfig.json中!)

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/54590880

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档