我正在构建我的第一个Angular应用程序。我正在使用此命令创建一个新的Angular应用程序ng new purchase-section
。但是,当我使用执行应用程序时ng serve -o
,出现以下错误。
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:需要表达式。
我已经检查了types.d.ts
它是由Angular创建的,因此我进行了检查。我无法理解该错误。请注意,在收到此错误后,我删除了该文件,node_modules
并使用npm install
希望安装的方法安装了此错误。
这是我的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"
}
}