简体   繁体   English

为什么我遇到这些Typescript编译时错误?

[英]Why I am getting these Typescript compile time errors?

I dont have any idea why these errors are appearing, while I copied the whole ClientApp folder from running application where these are not there. 我不知道为什么会出现这些错误,而我是从运行应用程序的地方复制了整个ClientApp文件夹,而这些地方却不存在。

在此处输入图片说明

My structure of project is ; 我的项目结构是;

在此处输入图片说明

Here is my package.json : 这是我的package.json:

{
  "name": "crossvertise-calander-system",
  "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": "^7.1.0",
    "@angular/cdk": "^7.1.0",
    "@angular/common": "^7.1.0",
    "@angular/compiler": "^7.1.0",
    "@angular/core": "^7.1.0",
    "@angular/forms": "^7.1.0",
    "@angular/material": "^7.1.0",
    "@angular/platform-browser": "^7.1.0",
    "@angular/platform-browser-dynamic": "^7.1.0",
    "@angular/router": "^7.1.0",
    "core-js": "^2.5.7",
    "rxjs": "^6.3.3",
    "saturn-datepicker": "^7.0.1",
    "@angular/http": "7.1.4",
    "@ng-bootstrap/ng-bootstrap": "4.0.1",
    "bootstrap": "4.1.3",
    "hammerjs": "^2.0.8",
    "jquery": "^3.3.1",
    "md-date-range-picker": "^0.8.3",
    "ng2-daterange-picker": "^1.1.0",
    "ngx-mat-daterange-picker": "0.0.2",
    "rxjs-compat": "^6.3.3",
    "tslib": "^1.9.0",
    "zone.js": "~0.8.26",
    "@mat-datetimepicker/core": "3.0.0-beta.0",
    "@mat-datetimepicker/moment": "3.0.0-beta.0"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "~0.11.0",
    "@angular/cli": "~7.1.3",
    "@angular/compiler-cli": "~7.1.0",
    "@angular/language-service": "~7.1.0",
    "@types/jasmine": "~2.8.8",
    "@types/jasminewd2": "~2.0.3",
    "@types/jquery": "^3.3.27",
    "@types/node": "~8.9.4",
    "codelyzer": "~4.5.0",
    "jasmine-core": "~2.99.1",
    "jasmine-spec-reporter": "~4.2.1",
    "karma": "~3.1.1",
    "karma-chrome-launcher": "~2.2.0",
    "karma-coverage-istanbul-reporter": "~2.0.1",
    "karma-jasmine": "~1.1.2",
    "karma-jasmine-html-reporter": "^0.2.2",
    "protractor": "~5.4.0",
    "ts-node": "~7.0.0",
    "tslint": "~5.11.0",
    "typescript": "~3.1.6"
  }
}

Can any body help me how to get rid of these errors. 任何机构都可以帮助我如何摆脱这些错误。 I dont know how to avoid these errors. 我不知道如何避免这些错误。 These are really slowing down my development 这些真的减慢了我的发展速度

Follow the below steps: 请按照以下步骤操作:

  • Delete your node_modules folder and package-lock.json file if it exists 删除您的node_modules文件夹和package-lock.json文件(如果存在)
  • Run npm install command 运行npm install命令

If this, still doesn't fix your problem, then in your spec.ts file, add the below import: 如果这样,仍然不能解决您的问题,请在spec.ts文件中添加以下导入:

import {} from 'jasmine';

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 我的代码中出现以下错误和警告,我不确定为什么 - I am getting the following errors and warnings in my code and I am not sure as to why 为什么我的CPU使用率始终为0%? - Why am I getting a CPU usage of 0% all the time? 为什么我只有5%的时间会出现Bad Data异常? - Why am I getting a Bad Data exception only 5% of the time? 尝试在运行时创建动态对象列表时,为什么会出现编译错误? - Why am I getting a compile error when I'm trying to create a list of a dynamic object at runtime? 为什么我第二次写入同一个文件时抛出隔离存储异常? - Why am I getting an IsolatedStorageException thrown the second time I am writing to the same file? 为什么在 Visual Studio 2022 中尝试恢复 NuGet 包时出现错误? - Why am I getting errors when trying to restore NuGet packages in Visual Studio 2022? 为什么我得到403? - Why am I getting a 403? 为什么在编译时我的VB.Net应用程序中不断显示“未定义类型”? - Why do I keep getting a “type is not defined” in my VB.Net application at compile time? 知道为什么我在此代码的.NET小提琴上收到“致命错误:超出执行时间限制”吗? - Any idea why I am getting “Fatal Error: Execution time limit was exceeded” on .NET fiddle for this code? 为什么会出现错误“未声明”? - Why am I getting error 'not declared'?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM