错误TS1005:“;"预期的. Node_modules中的TypeScript Angular 6 For First Build错误rxjs [英] Error TS1005: ';' expected. TypeScript Angular 6 For First Build error rxjs inside node_modules

查看:247
本文介绍了错误TS1005:“;"预期的. Node_modules中的TypeScript Angular 6 For First Build错误rxjs的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在构建我的第一个Angular应用程序.我正在使用此命令ng new purchase-section创建一个新的Angular应用程序.但是,当我使用ng serve -o执行应用程序时,出现了以下错误.

I'm building my first Angular Application. I'm creating a new Angular application using this command ng new purchase-section. But when I executing the application using ng serve -o I got the following error.

node_modules/rxjs/internal/types.d.ts(81,44)中的错误:错误TS1005: ';'预期的. node_modules/rxjs/internal/types.d.ts(81,74):错误 TS1005:;"预期的. node_modules/rxjs/internal/types.d.ts(81,77): 错误TS1109:需要表达.

ERROR in node_modules/rxjs/internal/types.d.ts(81,44): error TS1005: ';' expected. node_modules/rxjs/internal/types.d.ts(81,74): error TS1005: ';' expected. node_modules/rxjs/internal/types.d.ts(81,77): error TS1109: Expression expected.

我检查了types.d.ts,因为我知道它是由Angular创建的. 我无法理解该错误.请注意,收到此错误后,我删除了node_modules并使用npm install安装,希望我仍然可以得到此错误.

I have inspected types.d.ts as I know it is created by Angular. I'm not able to understand the error. Note that after I got this error I deleted node_modules and I installed using npm install wished I got away still I got this error.

这是我的package.JSON文件:

{
 "name": "purchase-section",
 "version": "0.0.0",
  "scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
 },
 "private": true,
   "dependencies": {
    "@angular/animations": "^6.0.3",
     "@angular/common": "^6.0.3",
     "@angular/compiler": "^6.0.3",
     "@angular/core": "^6.0.3",
     "@angular/forms": "^6.0.3",
      "@angular/http": "^6.0.3",
      "@angular/platform-browser": "^6.0.3",
      "@angular/platform-browser-dynamic": "^6.0.3",
      "@angular/router": "^6.0.3",
       "core-js": "^2.5.4",
       "rxjs": "^6.0.0",
        "zone.js": "^0.8.26"
       },
      "devDependencies": {
        "@angular-devkit/build-angular": "~0.6.8",
         "@angular/cli": "~6.0.8",
         "@angular/compiler-cli": "^6.0.3",
          "@angular/language-service": "^6.0.3",
           "@types/jasmine": "~2.8.6",
           "@types/jasminewd2": "~2.0.3",
            "@types/node": "~8.9.4",
             "codelyzer": "~4.2.1",
              "jasmine-core": "~2.99.1",
               "jasmine-spec-reporter": "~4.2.1",
                "karma": "^4.0.0",
                 "karma-chrome-launcher": "~2.2.0",
                  "karma-coverage-istanbul-reporter": "~2.0.0",
                   "karma-jasmine": "~1.1.1",
                 "karma-jasmine-html-reporter": "^0.2.2",
                 "protractor": "^5.4.2",
                  "ts-node": "~5.0.1",
                  "tslint": "~5.9.1",
                "typescript": "~2.7.2"
                 }
               }

推荐答案

我遇到了同样的问题.我调查了 rxjs 发布了新版本:6.4.0.它破坏了构建.根据审查,TypeScript的最低受支持版本为2.8.如果您不想更新TypeScript版本,只需在package.json中更改"rxjs": "^6.0.0", to "rxjs": "6.3.3".

I had the same issue. I investigated that rxjs released a new version: 6.4.0. And it broke the build. According to review, the minimum supported version of TypeScript is 2.8. If you don't want to update TypeScript version, just change "rxjs": "^6.0.0", to "rxjs": "6.3.3" in package.json.

这篇关于错误TS1005:“;"预期的. Node_modules中的TypeScript Angular 6 For First Build错误rxjs的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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