Error with jasmine node module in angular 2

I get the following error:

  • I tried to change my version of typescript, but this does not fix the problem.
  • I tried to work npm update --saveand still nothing work.

    ERROR in [default] /Users/gdayton/Documents/auction/node_modules/@types/jasmine/index.d.ts:39:37 Parameter initializer is allowed only in the implementation of a function or constructor.

    ERROR in [default] /Users/gdayton/Documents/auction/node_modules/@types/jasmine/index.d.ts:39:45 Unable to find the name "keyof".

    ERROR in [default] /Users/gdayton/Documents/auction/node_modules/@types/jasmine/index.d.ts:39:51 '=' is expected.

Here is my package.json file.

{
  "name": "auction2",
  "version": "0.0.0",
  "license": "MIT",
  "angular-cli": {},
  "scripts": {
    "start": "ng serve",
    "lint": "tslint \"src/**/*.ts\"",
    "test": "ng test",
    "pree2e": "webdriver-manager update",
    "e2e": "protractor"
  },
  "private": true,
  "dependencies": {
    "@angular/common": "2.0.0",
    "@angular/compiler": "2.0.0",
    "@angular/core": "2.0.0",
    "@angular/forms": "2.0.0",
    "@angular/http": "2.0.0",
    "@angular/platform-browser": "2.0.0",
    "@angular/platform-browser-dynamic": "2.0.0",
    "@angular/router": "3.0.0",
    "core-js": "^2.4.1",
    "rxjs": "5.0.0-beta.12",
    "ts-helpers": "^1.1.1",
    "zone.js": "^0.6.23"
  },
  "devDependencies": {
    "@types/jasmine": "^2.2.30",
    "angular-cli": "1.0.0-beta.16",
    "codelyzer": "~0.0.26",
    "jasmine-core": "2.4.1",
    "jasmine-spec-reporter": "2.5.0",
    "karma": "1.2.0",
    "karma-chrome-launcher": "^2.0.0",
    "karma-cli": "^1.0.1",
    "karma-jasmine": "^1.0.2",
    "karma-remap-istanbul": "^0.2.1",
    "protractor": "4.0.9",
    "ts-node": "1.2.1",
    "tslint": "3.13.0",
    "typescript": "2.0.2"
  }
}
+1
source share
2 answers

package.json . .

  • node_modules.
  • npm-cache C:\Users\USERNAME\AppData\Roaming
  • .
  • npm

    npm-check-updates -u
    
  • .json ,

    npm update --save
    

, npm ,

npm install -g npm-check-updates

, , .

+1

[default]/Users/gdayton/Documents/auction/ node_modules/@types/jasmine/index.d.ts:39:45 "keyof".

keyof Typescript 2.1, package.json Typescript 2.0.2. , , Typescript, , , .

+1

Source: https://habr.com/ru/post/1016530/


All Articles